GridView Modify column Header HeaderText

Source: Internet
Author: User


Recently, when you do a data list binding, you need the data column headings to dynamically change,

At first thought, through the HeaderText to find the corresponding column, and then set its headertext, found that it does not work;


Column.headertext= "TEST", I was written in the Bindgrid (), Can't you change the column at this time?


So, just try to create each row of rows of data?


In the Row_create () event, Judge E. Row.rowtype = = header, set E. row.cell[the corresponding column index]. text= "TEST" to write,

The operation can be set dynamically;


Later, also consulted the next colleague, they are generally written under the Row_databound,

The same code, pasted into the row_databound is also possible,


Then it appears that the Girdview data is generated in one line, and the content can be modified by a single line.


Mark has.

GridView Modify column Header HeaderText

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.