The gridview is a relatively powerful control, which is also complicated to use. Once again, we will summarize the usage experience of the gridview: 1. First, we will show the common methods and attributes of the gridview control: the gridview method:
Method |
Description |
Deleterow |
Delete data rows of the gridview control from the external |
Focus |
Set the gridview to focus |
Sort |
Sorts the gridview space based on the specified sorting expression and direction. |
Updaterow |
Update data rows of the gridview control from external sources |
Gridview event
Event |
Description |
Databinding |
Occurs when the server control is bound to the data source. |
Databound |
After the server control is bound to the data source |
Pageindexchanged |
Occurs after the gridview page is complete |
Pageindexchanging |
Occurs before the gridview page is complete |
Rowcancelingedit |
Occurs before the data row ends the editing mode by pressing the "cancel" button. |
Rowcommand |
An error occurred while pressing the button in the gridview control. |
Rowcreate |
When a row in the gridview control is created |
Rowdatabound |
When a data row is bound to the data in the gridview Control |
Rowdeleted |
After the gridview control deletes a data row (when the "delete" button of the Data row is pressed) |
Rowdeleting |
Before the gridview control deletes a data row (when the "delete" button of the Data row is pressed) |
Rowediting |
Before the gridview control enters the editing mode (when the "edit" button of the Data row is pressed ), |
Rowupdated |
After the gridview control updates the data row (when the "Update" button of the Data row is pressed) |
Rowupdating |
Before the gridview control updates the data row (when the "Update" button of the Data row is pressed) |
Selectedindexchanged |
After the selection job is completed in the gridview control (when the "select" button of the Data row is pressed) |
Selectedindexchanging |
Before the gridview Control completes the selection job (when the "select" button of the Data row is pressed) |
Sorted |
This occurs after the gridview Control completes the sorting job (when the hyperlink of the sorted data column is used ). |
Sorting |
When the gridview Control completes the sorting job (when the hyperlink of the sorted data column is used) |
2. rowtype and rowstate attributes of gridviewrow
Rowtype of gridviewrow: used to determine the type of the current row
row type |
description |
syntax |
header |
top |
datacontrolrowtype. header |
footer |
end of the page |
datacontrolrowtype. footer |
datarow |
general data rows |
datacontrolrowtype. datarow |
emptydatarow |
Empty data row |
datacontrolrowtype. emptydatarow |
pager |
pager |
datacontrolrowtype. Pager |
separator |
delimiter in the gridview Control |
datacontrolrowtype. Separator |