Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Renaming DataGridView Column Header at Runtime

Status
Not open for further replies.

dvannoy

MIS
May 4, 2001
2,765
0
0
US
I'm trying to rename a dg column header text at runtime. dg.Columns(1).HeaderText = "TEXT" I cannot seem to get the headertext to change. I've tried it in the RowDataBound event and no luck. tried on page load and no luck. I get no error but the header text doesn't change. I have auto generate columns set to false.

Any help would be appreciated



 
Post your GridView markup and any code you have tried so far
 
it turns out I was trying to format the header text before there was any data going into the grid. I had to make sure the datasource was set first on the grid then I was able to format the header text to what I wanted.

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top