Click here to Skip to main content
15,897,371 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
C# - Dynamically Changing Header Text Of A Gridview Column? how can i do it .please help me .
Posted
Comments
[no name] 7-Dec-12 3:46am    
Repost....

1 solution

Hi,

Check this

protected void Button1_Click(object sender, EventArgs e)
{
GridView1.Columns[0].HeaderText = "Your Dynamic string";
}


(or)

protected void GridView1_RowDataBound(object sender, System.Web.UI.WebControls.GridViewRowEventArgs e)
{
if (e.Row.RowType == DataControlRowType.Header) {
GridView1.Columns[0].HeaderText = "Your Dynamic string";

}
}
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900