Rowupdating how to
The following code listing is an example of how to implement generating a new primary key value to a new row of the grid.
So what you need to do is store the data source (maybe in Session) and only bind rebind the data when you absolutely need to (Like during the Is Not Post Back) Do you understand?
Also, all events with the -ing suffix are cancelable and the action can be terminated when in the handler is set to return false.
NET Grid View Tips and Tricks series, this post shows how to cancel the Update and Delete operation in an ASP. To cancel an update and delete operation, we will make use of the Row Updating and Row Deleting events.
The second parameter of the event handler includes the value member which is used to return the new primary key value back up to the grid.
By default, the value is initialized with a value that is equal to the number of rows in the data source.