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

Localization of grid column headers not working for hierarchical view

4 Answers 114 Views
GridView
This is a migrated thread and some comments may be shown as answers.
asp.net
Top achievements
Rank 1
asp.net asked on 05 Jul 2012, 02:43 PM
I am trying to localize the column headers using the following code for each of the column in the parent and the child gridviews in a hierarchical view.

<telerik:GridViewColumn.Header>
            <TextBlock Text="JudgementCode" telerik:LocalizationManager.ResourceKey="JudgementCode"></TextBlock>
  </telerik:GridViewColumn.Header>

This works fine for the main grid, but when I expand a row to see its child gridview, the child table column headers are not localized.

Is there something different I need to be doing for hierarchical gridveiw.

4 Answers, 1 is accepted

Sort by
0
Dimitrina
Telerik team
answered on 05 Jul 2012, 04:07 PM
Hi,

In both the cases (for the parent and for the child GridView) the localization should be applied fine. May I ask you to share some additional information on how have you set  your custom localization manager?

All the best,
Didie
the Telerik team

Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get it now >>

0
asp.net
Top achievements
Rank 1
answered on 05 Jul 2012, 04:29 PM
This is the line of code I have in App.cs, constructor

LocalizationManager.Manager = new CustomLocalizationManager();

And my CustomLocalizationManager is simple implementation, it just returns the upper case of the key passed. See below

 class CustomLocalizationManager : LocalizationManager
    {
        public override string GetStringOverride(string key)
        {
            switch (key)
            {
                default:
                    return key.ToUpper();                   
            }
        }
    }

As mentioned earlier, it works fine with TextBlock, Button, and Column Headers of the main table, but fails for the Column Headers of the child table.
0
Dimitrina
Telerik team
answered on 05 Jul 2012, 04:44 PM
Hello,

 This would be strange. I have attached a sample project showing how the resource is applied. Please check it and let me know what have you done different? 

Kind regards,
Didie
the Telerik team

Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get it now >>

0
asp.net
Top achievements
Rank 1
answered on 06 Jul 2012, 11:10 AM
This is going to be interesting. I am using the Text property of the TextBlock as well, so that I can see the header text in design mode. So, in your project I use this line of code in both the parent and child grids.

<TextBlock Text ="JudgementCode" telerik:LocalizationManager.ResourceKey="JudgementCode"></TextBlock>

I did this for both the parent grid and the child grid. Now I see only the parent grid column header translated but not the child grid column header.

Tags
GridView
Asked by
asp.net
Top achievements
Rank 1
Answers by
Dimitrina
Telerik team
asp.net
Top achievements
Rank 1
Share this question
or