New experiences of Asp.net gridview row binding event

Source: Internet
Author: User

I searched the online for the event execution sequence, and the test results showed that it was incorrect when there were pages.
Event execution sequence:

1. Display bound data in the gridview (5 rows by default ):CopyCodeThe Code is 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] // This event will occur no matter whether there are any corner lines.
Rowdatabound
Rowcreated: pager [7]
Rowdatabound
Databound

The order is as follows:

Databinding
Rowcreated
Rowdatabound
......
Databound

2. Order of events when the page button is clicked in the gridview:Copy codeThe Code is 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: When clicking the page Jump button, only the information of the page to be displayed will be bound. As shown above, no information will be bound to rowdatabound, only the total number of pages on the current page can be counted (as shown in the preceding 9-13 documents)

For now, we only need to make statistics on the information to be bound. Cannot be processed in the event 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.