开发者

Dynamically changing header text of a gridview column

开发者 https://www.devze.com 2023-02-08 08:21 出处:网络
Hi, I am using an A开发者_运维问答SP 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 cli

Hi, I am using an A开发者_运维问答SP 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?


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.


I think on particular button click it will not change you can only change by writing the required code in gridview RowDataBound event

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号