Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > ASP .Net Datagrid Control > Change HeaderText of datagrid after binding

Reply
Thread Tools

Change HeaderText of datagrid after binding

 
 
Sangra M via .NET 247
Guest
Posts: n/a
 
      03-14-2005
(Type your message here)

--------------------------------
From: Sangra
Hi,
I got a datagrid which I want to change the headertext after binding.
Because I have a multi-lingual app and I allow the user to change the
language on-the-fly. However, the headertext changes only after the
2ND TIME I pressed the Change language button. I'm doing the change
during the Page_Load event and I suppose the ASP.NET takes the
values of the headertexts BEFORE it, so it will be showed only on the
next time!
My question is what is the correct event I should catch and change the
text?
Many thanks in advance!

-----------------------
Posted by a user from .NET 247 (http://www.dotnet247.com/)

<Id>GgIRLqizMEW0GTv0rPM03A==</Id>
 
Reply With Quote
 
 
 
 
Sylvain Lafontaine
Guest
Posts: n/a
 
      03-14-2005
Using the datagrid's ItemCreated event is probably the best choice. The
ItemDataBound won't work in this case because the header is not an item (not
associated with a data). See for example:

http://msdn.microsoft.com/msdnmag/is...g/default.aspx
http://www.codeproject.com/aspnet/Me...gridHeader.asp
http://www.datagridgirl.com/articles.aspx

S. L.

"Sangra M via .NET 247" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> (Type your message here)
>
> --------------------------------
> From: Sangra
> Hi,
> I got a datagrid which I want to change the headertext after binding.
> Because I have a multi-lingual app and I allow the user to change the
> language on-the-fly. However, the headertext changes only after the
> 2ND TIME I pressed the Change language button. I'm doing the change
> during the Page_Load event and I suppose the ASP.NET takes the
> values of the headertexts BEFORE it, so it will be showed only on the
> next time!
> My question is what is the correct event I should catch and change the
> text?
> Many thanks in advance!
>
> -----------------------
> Posted by a user from .NET 247 (http://www.dotnet247.com/)
>
> <Id>GgIRLqizMEW0GTv0rPM03A==</Id>



 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Can not change Headertext with sorting ability in Griview from code behind Charly ASP .Net 1 02-20-2010 04:46 AM
Change HeaderText in datagrid Řyvind Isaksen ASP .Net 1 11-06-2005 02:19 PM
How do I change the headertext of a datagrid column programmatically Ravi Gudlavalleti ASP .Net Datagrid Control 1 06-17-2004 11:48 PM
change HeaderText of DataGrid in PreRender(). Andy Wang ASP .Net Datagrid Control 6 05-16-2004 09:49 AM
change HeaderText of DataGrid in PreRender() Andy Wang ASP .Net 0 05-12-2004 08:56 PM



Advertisments