• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 1152
  • Last Modified:

Change column header text in Gridview control using C#

How do I change column header text in Gridview control using C#
0
snapsy
Asked:
snapsy
1 Solution
 
pendemCommented:
In the RowDataBound Event of your GridView, write the code as below to change the column header at runtime:


//gvr is your GridView

if (gvr.RowType == DataControlRowType.Header)
        {
            LinkButton lbtn = gvr.Cells[0].Controls[0];
            lbtn.Text = "Your Header";
}

Open in new window

0

Featured Post

Keep up with what's happening at Experts Exchange!

Sign up to receive Decoded, a new monthly digest with product updates, feature release info, continuing education opportunities, and more.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now