I searched the order of the event execution on the Internet and tested it incorrectly in the case of paging.
Event Execution Order:
One, the GridView displays the bound data (default is 5 rows):
Copy Code code as follows:
DataBinding
ROWCREATED:HEADER[0]
RowDataBound
ROWCREATED:DATAROW[1]
RowDataBound
ROWCREATED:DATAROW[2]
RowDataBound
ROWCREATED:DATAROW[3]
RowDataBound
ROWCREATED:DATAROW[4]
RowDataBound
ROWCREATED:DATAROW[5]
RowDataBound
ROWCREATED:FOOTER[6]//Regardless of whether there is a page corner row, this event will occur
RowDataBound
ROWCREATED:PAGER[7]
RowDataBound
DataBound
The order is as follows:
DataBinding
RowCreated
RowDataBound
......
DataBound
The sequence of events when the GridView clicks the paging button:
Copy Code code as follows:
Rowcommand
Pageindexchanging
PageIndexChanged
DataBinding
ROWCREATED:HEADER[8]
RowDataBound
ROWCREATED:DATAROW[9]
RowDataBound
ROWCREATED:DATAROW[10]
RowDataBound
ROWCREATED:DATAROW[11]
RowDataBound
ROWCREATED:DATAROW[12]
RowDataBound
ROWCREATED:DATAROW[13]
RowDataBound
ROWCREATED:FOOTER[14]
RowDataBound
ROWCREATED:PAGER[15]
RowDataBound
DataBound
Understanding is that in the click of the page button, only binding to the page to display the data, such as, so in the rowdatabound will not bind all the data, at this time to statistics, can only count the current page of the sum (such as 9-13 of the information)
At present, only the data to be bound is counted. cannot be handled in the events in the GridView.