Last post Sep 01, 2008 05:31 PM by vit0
May 19, 2006 12:55 AM|polonskyg|LINK
I have read a lot about localizing, but i haven't found how can i localize datagrid headers that i'm creating at run-time, i mean i create buttoncolumns and other columns at runtime, and i want to change the header text of each one depending on the language
Thanks in advance. Guillermo.
Jun 02, 2006 04:36 PM|techy_unknown|LINK
I spent bit time with the issue. And I have not found any "streat" solution to this issue. So, I capture RowDataBound(GridView event-VS2005. ItemDataBound in DataGrid-VS2003) event, in which if the row type is of the "header" then i retrive the header text
which is mentioned at the design time i.e. in aspx. And from those header text I retrieve the values from the resource file. I am pasting the code below, have a look.
Following code is of the GridView which is similar to the DataGrid.
Also Note that "rm" is global variable of
ResourceManager and instantiated at the Page_Init.
Protected Sub gv_RowDataBound(ByVal sender
ByVal e As System.Web.UI.WebControls.GridViewRowEventArgs)
If e.Row.RowType = DataControlRowType.Header
e.Row.Cells(0).Text = rm.GetString(e.Row.Cells(0).Text)
e.Row.Cells(1).Text = rm.GetString(e.Row.Cells(1).Text)
e.Row.Cells(2).Text = rm.GetString(e.Row.Cells(2).Text)
e.Row.Cells(3).Text = rm.GetString(e.Row.Cells(3).Text)
Jun 07, 2006 02:43 PM|kalaka2|LINK
it's very easy. ok i saw you for a gridview
1. you must disable automatic generation of columns
2. in your Page_load event you type:
Sep 01, 2008 05:31 PM|vit0|LINK
Can you tell me how should look like resource file for localizing DataGrid headers?