ASP. NET gridview controls

Source: Internet
Author: User

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
Related Article

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.