We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. (Last updated on: November 16, 2018).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

What grid event should be used to write to a database?

Thread ID:





32841 Aug 8,2005 09:42 PM UTC Aug 8,2005 10:36 PM UTC WinForms 1
Tags: GridControl
dan carr
Asked On August 8, 2005 09:42 PM UTC

I am using a DataBoundDataGrid to (validate and) write to a SQL Server database. It works ok but there are 2 issues: (1) Specifically what event should I use to write to a database? When I use CurrentCellValidating I cannot always validate the current record because the user may click onto a different row. Is there some way to find out which row we just came from? Or is there some event which fires before we reach the new cell? (2) While using CurrentCellValidating--if I change a cell and then check the value I see the old value, not the new value. How can I see the new value? Thanks, Dan

Administrator [Syncfusion]
Replied On August 8, 2005 10:36 PM UTC

By default, the grid saves the changes to a row back to the datasource when you leave the row. So, if your datasource is a datatable, the datarow will not actually change until the user leaves the row. If you want to write the changes back to your database from the datatable at that point, you should use the RowSaved event. At that point, the grid has saved the row back to teh Datatable, and you could then move the datatable back to your database. In CurrentCellValidating, you can get the proposed new value using grid.CurrentCell.Renderer.ControlText.


This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

Please sign in to access our forum

or the page will be automatically redirected to sign-in page in 10 seconds.

Warning Icon You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.Close Icon