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

[Solved] How to refresh grouping header when assigning new culture

3 Answers 183 Views
GridView
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
uku
Top achievements
Rank 1
uku asked on 03 Mar 2011, 09:36 AM
Hello,

please assist me with a localization problem I have when changing the culture info without reloading the page.
I have a grid and a pager translated in several languages.

The translation works perfectly when the culture is set before the page is loaded. Then the grouping header, the filter dialog and the pager are shown in the certain language.

When I change the cultureinfo when the page is already loaded then just the filter dialog is shown in the new language. The grouping header and the pager texts are not refreshed.

I'm firing an event when the language changes and tried the following code to change the language on the fly, but this way seems not to work.
void _appSetting_OnLanguageChanged(object sender, LanguageChangedEventArgs e)
{
    LocalizationManager.DefaultCulture = e.CultureInfo;
}

Thanks

Uwe

3 Answers, 1 is accepted

Sort by
0
Milan
Telerik team
answered on 03 Mar 2011, 04:59 PM
Hello uku,

Unfortunately it is not possible to refresh localization text without reloading the whole page. Whenever DefaultCulture is changed all currently displayed pages should be reloaded.


Best wishes,
Milan
the Telerik team
Registration for Q1 2011 What’s New Webinar Week is now open. Mark your calendar for the week starting March 21st and book your seat for a walk through all the exciting stuff we ship with the new release!
0
uku
Top achievements
Rank 1
answered on 03 Mar 2011, 08:04 PM
Hello Milan,

thanks for the answer but unfortunately this was not the answer I was hoping for.

Do you have an idea if there is a workaround?

Is there a possibility to assign the texts manually to the grouping header or to the pager? For the internal texts of the Telerik controls, I'm currently using a different solution, than I normaly use for the rest of my UI texts, because I don't how to use it in the same way.

What I'm normally using is the MVVM pattern and all texts, like column headers etc., are exposed as properties by the view model. When the culture is changed by the user via the according functionality within my app than I simply walk through all texts and assign the new.texts. This is like the whole internationalization of the UI is working in my app, beside the internal texts e.g. of the GridView and Pager.
It would be perfect if I could bind these internal texts in the same way to my view model.

Hopefully you have any ideas how to change the language without reloading the page.

Thanks

Uwe
0
Accepted
Pavel Pavlov
Telerik team
answered on 08 Mar 2011, 11:09 AM
Hello uku,

Actually y u can bind the text in the grouping panel .  For this you will need to tamper a bit with the default template of RadGidView. I have opened RadGridView with Blend and changed a setting for the GroupPanel text to bind it to a property of the DataContext.
You may see the result attached ( runnable project) .

Regards,
Pavel Pavlov
the Telerik team
Registration for Q1 2011 What’s New Webinar Week is now open. Mark your calendar for the week starting March 21st and book your seat for a walk through all the exciting stuff we ship with the new release!
Tags
GridView
Asked by
uku
Top achievements
Rank 1
Answers by
Milan
Telerik team
uku
Top achievements
Rank 1
Pavel Pavlov
Telerik team
Share this question
or