We need to write our own code to update the new values back to the database in the Row Updating event.Add the following code in the Row Editing event handler: The Row Editing event handler receives an event argument of type Grid View Edit Event Args.We set Page Index property of the Grid View to this new page number and call the Bind Grid() method again.This will display the corresponding records in the Grid View.The Cancel property allows you to cancel the sorting operation.Since we are not using data source controls we need to handle the toggling of the sort direction on our own. Add the following code in the Sorting event handler.In order to implement paging you need to set Allow Paging property of the Grid View control to True. There are two events of Grid View that are related to paging.
Here, we first retrieve the new values entered in the textboxes.
The Grid View Sort Event Args class has three important properties.
The Sort Expression property supplies the sort expression that you specified earlier for the column being sorted.
Once you set these properties you will find that the column headers of all the columns for which you specified Sort Expression property appear as clickable link buttons.
Clicking on the link buttons raise two events: Just like paging events these events follow pre and post pattern.