Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Problem trying to change the GridView column header
Message
 
 
À
Tous
Information générale
Forum:
ASP.NET
Catégorie:
Autre
Titre:
Problem trying to change the GridView column header
Versions des environnements
Environment:
C# 3.0
OS:
Windows XP
Network:
Windows 2003 Server
Database:
MS SQL Server
Divers
Thread ID:
01332133
Message ID:
01332133
Vues:
51
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
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform