New experience in asp.net GridView Line binding Events _ practical skills

Source: Internet
Author: User
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.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.