I have previously posted an article on how to insert new rows in database using a Grid View.
In this article however, I'll show you how a Grid View control can be used to update (edit), delete and insert data in a remote SQL Server table. Attach the Grid View with the Sql Data Source control, the way we have shown the link above.
Whatever the case may be, you can cancel most of the Web Data Grid events that end in "ing".
The following code shows you how to cancel Web Data Grid’s client-side and server-side Row Updating events.
I am confused at this point on why my markup and code behind is not touching the Row Updating event when Update button is clicked. The routine loading of the product table now happens only on the first pass through the code behind.
Using the Row Updating handler, we can do whatever we want.
What the line of code says is “cancel any other update processing that may have happened after this event gets called.” From here on out, you’ll need to retrieve the values from your edit controls manually using the Find Contro By ID() method I demonstrated on Monday and updating the database using code.
For demonstration I have created a database (named Database.mdf) in which we have a table named tbl_Employee.
Net is useful for displaying large data in a tabular format.