473,503 Members | 5,495 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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 2285
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
2413
by: lu | last post by:
I have a page with datagrid (for viewing, delete,edit,update) and text fields with button to add info to database. When user comes to page the datagrid selects info from database, binds in...
3
4855
by: Jim Heavey | last post by:
Trying to figure out the technique which should be used to add rows to a datagrid. I am thinking that I would want an "Add" button on the footer, but I am not quite sure how to do that. Is that...
2
2016
by: Marty McDonald | last post by:
When setting certain datagrid properties with the IDE (as in the property window), they don't seem to take effect. For instance, Font Name. So I have to set these via code-behind at the cell...
3
2494
by: Ben | last post by:
Hi, I'm wondering how can i change the datagrid header text at runtime so that it keeps the sorting enabled? I can do; e.Item.Cells.Text = "foo"; But then foo is the text of the table cell...
5
2756
by: tshad | last post by:
Is there a way to carry data that I have already read from the datagrid from page to page? I am looking at my Datagrid that I page through and when the user says get the next page, I have to go...
1
2680
by: Gunjan Garg | last post by:
Hello All, I am working to create a generic datagrid which accepts a datasource(ListData - This is our own datatype) and depending on the calling program customizes itself for sorting,...
2
3427
by: Mike Baugh | last post by:
I am using visual studio 2005 to develop a form using c# I have 3 datagrids on one form. I can set the row color based on a certain value in a column. However this color applies to all 3...
3
4347
by: rn5a | last post by:
A SqlDataReader is populated with the records from a SQL Server 2005 DB table. The records retrieved depends upon 2 conditions (the conditions depend on what a user selects in an ASPX page). If...
1
1253
by: whidbey | last post by:
Hello frnds, I have created a datagrid with the following code...... <asp:datagrid id="DataGrid1" BackColor="#ccccff" BorderColor="black" Width="750" Runat="server" AutoGenerateColumns="False"...
0
2057
by: rupalirane07 | last post by:
Both grids displays fine. But the problem is only parent datagrid sorting works fine but when i clik on child datagrid for sorting it gives me error: NullReferenceException error Any...
0
7207
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
7291
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
7357
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
1
7012
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
7468
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
1
5023
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
4690
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
1
748
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
402
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

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.