471,348 Members | 1,893 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 471,348 software developers and data experts.

DataGrid.Columns.HeaderText problem in ASP.NET ?

First, excuse me for my very bad English.
I need your help for using DataGrid.Columns[..].HeaderText

I have a DataGrid in WebForm . I have a Session variable "LANGUAGE " in wich
I storing values ENG or FR.
On the page I have 2 linkButtons for the 2 languages - when the user click
on the the button, the form is initialize with the language.
Everything is OK, except initializing of the HeaderText of the DataGrid. I
try many methods for initialize - in Page_Load, in PreRender, in
ItemDataBound etc. events,
But the the HeaderText cant receive the right value . Example:
In prerender event I have break point . Session variable in this moment is
"ENG" , and I see in the debbuger that the header text receive the right
value in English, but when the page is loaded - the value is on french. If
AFTER THAT I click FR link button , in prerender event the value of Se3ssion
variable is FR, the value of Headertext is on french, but when the page is
loaded - value is on English . In conclusion : in Prerender, ItemDataBound
etc. events - in the debugger everything is OK with right values, but when
the page is loaded the values of HeaderText properties is on the previous
lanuage :

Please if you can help me - write me !
Best regards !
Toma
Aug 3 '05 #1
2 2220
Toma,

This sounds for me if the datagrid.databind happens to early

Just an idea about something that once was happening me in past

Cor
Aug 3 '05 #2
Thank you very much Cor!!!
Your opinion was like flash for me ...Really, the problem was that I make
DataGrid.DataBind in the Page_Load, and in language linkbutton event I'm
trying only to change the HeaderText of the grid columns /without any other
initializing/...Maybe I can't explain well the situation, but thanks to you I
found the solution....
Thanks again !
Best regards ,
Toma

"Cor Ligthert [MVP]" wrote:
Toma,

This sounds for me if the datagrid.databind happens to early

Just an idea about something that once was happening me in past

Cor

Aug 3 '05 #3

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

reply views Thread by lu | last post: by
3 posts views Thread by Jim Heavey | last post: by
2 posts views Thread by Marty McDonald | last post: by
3 posts views Thread by Ben | last post: by
1 post views Thread by Ronak mishra | last post: by

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.