DataGrid.Columns.HeaderText problem in ASP.NET ?

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

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
 
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
 
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
 
Back
Top