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

Multiple LocalizationManagers

3 Answers 83 Views
GridView
This is a migrated thread and some comments may be shown as answers.
Fredrik
Top achievements
Rank 2
Fredrik asked on 22 Oct 2013, 07:58 AM
Hello!
in my project i use several diffrent telerik controls that i need to overide its default Localization resource and replace it with my own.

I do this in a own baseview class witch all my other view classes inherits.

private void InitLocalizationManagers()
{
LocalizationManager.Manager = new LocalizationManager()
{
ResourceManager = Parka.Resources.Localization.GridViewResources.ResourceManager

};

LocalizationManager.Manager = new LocalizationManager()
{
ResourceManager = Parka.Resources.Localization.RadImageEditor.ResourceManager
};


}

However my problem is when i need to set up multiple resources for the diffrent controls.
in the example over i can only set the one resource since the top one will be overwritten.
i need to be able to set multiple



3 Answers, 1 is accepted

Sort by
0
Dimitrina
Telerik team
answered on 25 Oct 2013, 07:54 AM
Hi,

You can set different LocalizationManagers for the different controls.
You can create two localization managers and assign them to the corresponding controls (RadGridView and RadImageEditor) before the UI is created.

As to RadGridView, you can subscribe for the DataLoaded event and execute a code similar to this one:

private void playersGrid_DataLoading(object sender, Telerik.Windows.Controls.GridView.GridViewDataLoadingEventArgs e)
{
    LocalizationManager.Manager = new LocalizationManager()
             {
                 ResourceManager = Parka.Resources.Localization.GridViewResources.ResourceManager
              };
}

That way the localization will only be applied to this particular control.

Still you can only assign one LocalizationManager for your application. 

Regards,
Didie
Telerik
TRY TELERIK'S NEWEST PRODUCT - EQATEC APPLICATION ANALYTICS for SILVERLIGHT.
Learn what features your users use (or don't use) in your application. Know your audience. Target it better. Develop wisely.
Sign up for Free application insights >>
0
Fredrik
Top achievements
Rank 2
answered on 25 Oct 2013, 08:19 AM
Hello, I work with mvvm and thus your sollution is not viable for me.
i cannot subscribe for load event in every view and usercontrol i run telerik controls.
i have my base view class for this purpose.

is there no other way to assign ressourcemanager in a mvvm friendly way?
0
Dimitrina
Telerik team
answered on 25 Oct 2013, 04:05 PM
Hello,

You could use an attached behavior to assign your custom LocalizationManager in XAML and not in code behind. 
You can also check our online documentation on localization.
 

Regards,
Didie
Telerik
TRY TELERIK'S NEWEST PRODUCT - EQATEC APPLICATION ANALYTICS for SILVERLIGHT.
Learn what features your users use (or don't use) in your application. Know your audience. Target it better. Develop wisely.
Sign up for Free application insights >>
Tags
GridView
Asked by
Fredrik
Top achievements
Rank 2
Answers by
Dimitrina
Telerik team
Fredrik
Top achievements
Rank 2
Share this question
or