|
web
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
Change HeaderText of datagrid after binding-------------------------------- 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> 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/issues/01/10/cutting/default.aspx http://www.codeproject.com/aspnet/MergeDatagridHeader.asp http://www.datagridgirl.com/articles.aspx S. L. Show quoteHide quote "Sangra M via .NET 247" <anonym***@dotnet247.com> wrote in message news:uzz2goHKFHA.3336@TK2MSFTNGP10.phx.gbl... > (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>
5th Re-Post with NO RESPONSE FROM MS!
Questions concerning detailsview or datagrid ASP.NET 2.0 Can't get a reference to user control in datagrid Problem with Top And Bottom Paging How to capture CheckChanged event from Radiobutton in Datagrid? radiobutton and datagrid DataGrid sort when Editing Make links different color in the datagrid Handling events for Checkbox in Data Grid search function on different page selected |
|||||||||||||||||||||||