【问题标题】:Dynamically changing header text of a gridview column动态更改 gridview 列的标题文本
【发布时间】:2011-02-01 08:49:29
【问题描述】:

您好,我正在使用 ASP GridView。我在HeaderTemplate 中声明了一个标签,用于设置特定列的标题。如何在特定按钮单击时动态更改标题文本?

【问题讨论】:

    标签: c# asp.net gridview


    【解决方案1】:

    如果我理解正确,这就是你需要的,

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

    希望对您有所帮助。

    【讨论】:

      【解决方案2】:

      我认为在特定按钮上单击它不会改变你只能通过在 gridview RowDataBound 事件中编写所需的代码来改变

      【讨论】:

        猜你喜欢
        • 2012-10-12
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        相关资源
        最近更新 更多