473,385 Members | 1,798 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 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 2277
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
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
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
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
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
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
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
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
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
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
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
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...

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.