The GridView control exposes paging and sorting events, and events that occur when the current row is created or bound to data. Events are also raised when a command control such as a Button control that is included as part of the GridView control has been clicked. The following table describes the events exposed by the GridView control.
Occurs when a pager button is clicked, but before the GridView control performs the paging operation. This event is often handled to cancel the paging operation.
Occurs when a pager button is clicked, but after the GridView control performs the paging operation. This event is commonly handled when you need to perform a task after the user navigates to a different page in the control.
Occurs when a row's Select button (a button with its CommandName property set to "Select") within a GridView control is clicked, but before the GridView control performs the select operation. This event is often handled to cancel the selection operation.
Occurs when a row's Select button within a GridView control is clicked, but after the GridView control performs the select operation. This event is often handled to perform a task after a row is selected in the control.
Occurs when the hyperlink to sort a column is clicked, but before the GridView control performs the sort operation. This event is often handled to cancel the sorting operation or to perform a custom sorting routine.
Occurs when the hyperlink to sort a column is clicked, but after the GridView control performs the sort operation. This event is commonly handled to perform a task after the user clicks on a hyperlink to sort a column.
Occurs when a row in the GridView control is bound to a data record. This event is often handled to modify the contents of a row when the row is bound to data.
Occurs when a new row is created in the GridView control. This event is often handled to modify the layout or appearance of a row when the row is created.
Occurs when a row's Delete button (a button with its CommandName property set to "Delete") within a GridView control is clicked, but before the GridView control deletes the record from the data source. This event is often handled to cancel the deleting operation.
Occurs when a row's Delete button is within a GridView control clicked, but after the GridView control deletes the record from the data source. This event is often handled to check the results of the delete operation.
Occurs when a row's Edit button (a button with its CommandName property set to "Edit") within a GridView control is clicked, but before the GridView control enters edit mode. This event is often handled to cancel the editing operation.
Occurs when a row's Cancel button (a button with its CommandName property set to "Cancel") within a GridView control is clicked, but before the GridView control exits edit mode. This event is often handled to stop the cancel operation.
Occurs when a row's Update button (a button with its CommandName property set to "Update") within a GridView control is clicked, but before the GridView control updates the record. This event is often handled to cancel the updating operation.
Occurs when a row's Update button within a GridView control is clicked, but after the GridView control updates the record. This event is often handled to check the results of the update operation.