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

RadGrid HeaderContextMenu - Translating menu items

3 Answers 134 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Maikel
Top achievements
Rank 1
Maikel asked on 20 Jul 2011, 09:18 AM
The HeaderContextMenu in a RadGrid will display a number of items, such as "Sort Ascending", "Clear Sorting" and "Columns".

I want to translate these items globally, preferably in the theme files we use for the various cultures. This is already possible for items such as the NoMasterRecordsText in the MasterTableView. How can I do this for the items in the HeaderContextMenu, for all grids in my application?

3 Answers, 1 is accepted

Sort by
0
Accepted
Princy
Top achievements
Rank 2
answered on 20 Jul 2011, 10:16 AM
Hello Maikel,

You can achieve this by using global resources. Check the following code library and help documentation which explains more about this.
Global resources for RadGrid.
Localization through global resources.

Thanks,
Princy.
0
Maikel
Top achievements
Rank 1
answered on 21 Jul 2011, 07:45 AM
Hello Princy,

Using global resource files for localization of the RadGrid would be perfect as we use those for all our other translations as well. Unfortunately, it doesn't entirely seem to work. I've added the resource files RadGrid.Main.resx and RadGrid.Main.nl-BE.resx (I renamed this one to nl-NL as this is the culture we use for Dutch). We set the UI culture of the thread in the sub Page.InitializeCulture which I believe is the correct way of doing it. When I run the application, all other controls use the correct culture to get the resource (so I see everything in Dutch). The grid is still showing the header context menu in English. If I change a resource in the RadGrid.Main.resx file, I do see the new text in my application. I've also tried setting the UI culture of the thread to nl-BE and adding the resource file nl-BE in its original form, but that did not work either.

Thanks for your help,

Maikel
0
Maikel
Top achievements
Rank 1
answered on 25 Jul 2011, 12:03 PM
Just as an FYI to those who are also facing this problem: you have to set the Culture property of the grids, instead of changing the CurrentCulture property of the current thread (which, according to me, is the easy way of going about things). Fortunately, you can set the Culture property of all grids globally by adding it to the correct Theme file (if you, like us, have a separate Theme file for each culture).

I can't mark this post as an answer, so I will mark Princy's post as the answer since it did eventually lead me to the solution.
Tags
Grid
Asked by
Maikel
Top achievements
Rank 1
Answers by
Princy
Top achievements
Rank 2
Maikel
Top achievements
Rank 1
Share this question
or