Dynamically changing gridview column header text

Hi, I am using ASP GridView . I declare a single label in the HeaderTemplate to set the header of a specific column. How can I dynamically change the title text on a specific button?

+4
source share
2 answers

If I understood correctly, this is what you need,

 protected void Button1_Click(object sender, EventArgs e) { this.gvw1.Columns[0].HeaderText = "The new header"; } 

Hope this helps.

+11
source

I think that it will not change to a specific button click, you can only change it by writing the required code in the RowDataBound gridview event

+3
source

Source: https://habr.com/ru/post/1337918/


All Articles