This is a migrated thread and some comments may be shown as answers.

[Solved] How do you localize RADGrid headers ?

1 Answer 199 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Dennis Riis
Top achievements
Rank 1
Dennis Riis asked on 05 Nov 2009, 11:19 AM
If I have a RADGrid, such as:

        <telerik:RadGrid runat="server" ID="radGrid" PageSize="25" 
            AllowPaging="true"  
            AllowSorting="true"  
            AutoGenerateColumns="false" > 
            <PagerStyle Mode="NextPrevNumericAndAdvanced" /> 
            <MasterTableView> 
                <Columns> 
                    <telerik:GridBoundColumn DataField="ItemNumber" HeaderText="Item number" AllowSorting="true"  /> 
                    <telerik:GridBoundColumn DataField="Name" HeaderText="Name" /> 
                    <telerik:GridBoundColumn DataField="ShortDescription" HeaderText="Description" /> 
                    <telerik:GridBoundColumn DataField="Price" HeaderText="Price" /> 
                </Columns> 
            </MasterTableView> 
        </telerik:RadGrid> 

What is the preferred way to localize the HeaderText values ? (Say, if the page is being shown in the Danish culture, I would like to display the danish names as column headers, instead of english ones).

I possible, I would like to do this in the markup. I already have a helper method such as:
HeaderText="<%= Translate.Text("ItemNumber") %>" 

But if I try to do this on a Column, I get a parser error: "Literal content ('<telerik:GridBoundColumn DataField="ItemNumber" HeaderText="') is not allowed within a 'Telerik.Web.UI.GridColumnCollection'."

1 Answer, 1 is accepted

Sort by
0
Shinu
Top achievements
Rank 2
answered on 05 Nov 2009, 11:45 AM
Hi Dennis,

I have seen a documentation on localizing the grid header from code behind. Go through the following link and see whether it helps.
Localizing the grid headers

-Shinu.
Tags
Grid
Asked by
Dennis Riis
Top achievements
Rank 1
Answers by
Shinu
Top achievements
Rank 2
Share this question
or