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

Column Header Localization

3 Answers 116 Views
GridView
This is a migrated thread and some comments may be shown as answers.
Bhaskarkiran
Top achievements
Rank 2
Bhaskarkiran asked on 14 Mar 2011, 08:01 PM
I am developing an application which has to be localized in all aspects viz labels, Grid headers etc.  So to achieve this I have a dropdown in my Main page with all the supporting languages, On change of the language all my controls text change according to culture.  

Now i want to implement the same logic on RadGridView Column Header.  Can any one suggest me a solution to achieve the same.




Thanks in advance

3 Answers, 1 is accepted

Sort by
0
Maya
Telerik team
answered on 15 Mar 2011, 03:26 PM
Hello Bhaskarkiran,

Please, take a look at our demos for a reference.  

All the best,
Maya
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
Bhaskarkiran
Top achievements
Rank 2
answered on 15 Mar 2011, 06:50 PM
Hi Maya,
I have gone through the demos for localization of grid headers.  The demo logic will not fullfil my requirement as you are creating the columns from code behind and on selection change of Radio Buttons you are repainting the Grid.

My logic is like: I have  a dropdown with all the supporting Cultures on my Main Page, And an INotifyPropertyChanged class to identify the culture Change and based on the change I am Binding the Culture text to the controls.
Below is the Sample code

 
<StackPanel Style="{StaticResource AddressStackPanelStyle}">
<TextBlock x:Name="AshramTextBlock"  Text="{Binding LocalizationResources.AshramTextBlock}"
    Style="{StaticResource HeaderNameStyle}" />
 <TextBlock x:Name="AddressTextBlock"  Text="{Binding LocalizationResources.AddressTextBlock}"
         Style="{StaticResource AddressStyle}" />
<TextBlock x:Name="PhoneTextBlock"  Text="{Binding LocalizationResources.PhoneTextBlock}" Style="{StaticResource AddressStyle}" />
</StackPanel>

I want to Implement change of cultures on the fly.  Any suggestions are welcomed.

Thanks
Bhaskar
0
Maya
Telerik team
answered on 21 Mar 2011, 09:00 AM
Hi Bhaskarkiran,

Generally, this is required as the UI needs to be updated. In the example in our demos the element changing the language/theme is outside the main view - in this case it is outside the main grid. So, once you click on the button for modifying the culture, you can recreate the required element - the RadGridView in this case. You may take a look at this forum thread as well for additional reference on the idea. 
The other possibility is to implement a navigation logic using the Silverlight Navigation Framework. Thus you may "map" to the correct page with its specific localized strings. When setting the UriMapping, you may define a 'parameter' {culture} that will be responsible for separating the different pages and passing the corresponding culture. 
The way you try to work with by using bindings is quite all right if you can get the required element and bind its Text/Content property for example. However, as it is the case with the RadGridView, you will have get all the necessary templates and try to bind every single element that requires localization. Generally, this is done by our LocalizationManger internally.
 

All the best,
Maya
the Telerik team
Tags
GridView
Asked by
Bhaskarkiran
Top achievements
Rank 2
Answers by
Maya
Telerik team
Bhaskarkiran
Top achievements
Rank 2
Share this question
or