Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Problem trying to change the GridView column header
Message
 
General information
Forum:
ASP.NET
Category:
Other
Environment versions
Environment:
C# 3.0
OS:
Windows XP
Network:
Windows 2003 Server
Database:
MS SQL Server
Miscellaneous
Thread ID:
01332133
Message ID:
01332136
Views:
8
It works if you put this code in RowCreated method.

>Hi everybody,
>
>I have a button that changes a DataSourceID for the GridView. In the Row_DataBound method I have this code to change the header
>
>if (e.Row.RowType == DataControlRowType.Header)
>{
>
>if (clseditmode.CurDS == "FriendsAndVolunteersDataSource")
>{
>
>//this.ProfilesGrid.Columns[3].HeaderText = "Volunteer Name";
>
>e.Row.Cells[2].Text = "Volunteer Name";
>}
>
>if (Session.Count > 0) //dts saved in Session
>
>e.Row.Cells[2].Text = "Relation";
>}
>
> The problem is that when I select a record in a GridView, this new header disappears. How can I make it stay? Should I try to re-bind my GridView in every Page_Load? Any other ideas?
>
>Thanks a lot in advance.
If it's not broken, fix it until it is.


My Blog
Previous
Reply
Map
View

Click here to load this message in the networking platform