Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Dynamically changing header text of a gridview column

Hi, I am using an ASP GridView. I declare one label in HeaderTemplate for setting heading of a particular column. How can I dynamically change the header text on a particular button click?

like image 624
Nithesh Narayanan Avatar asked Dec 09 '22 11:12

Nithesh Narayanan


1 Answers

If I understood right, this is what you need,

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

Hope that helps.

like image 174
Ken D Avatar answered Jan 23 '23 23:01

Ken D