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

Rad Grid Localization Issue

1 Answer 74 Views
GridView
This is a migrated thread and some comments may be shown as answers.
Arun
Top achievements
Rank 1
Arun asked on 14 Jun 2013, 02:06 PM
Hi,
         I am facing issue while working with Localization, my scenario is as follows:
=> I am having Rad DataGrid and we are binding the columns dynamically, while binding I am handling the localization in code behind from the resx file.
The scenario in which  I am facing issue is for certain columns I need to change color  of some rows depending on certain condition. To achieve this  I hardcode the column name and it was working fine by using a converter. But as I can't hardcode the column name I need to use localization and get the results which I am not able to achieve. here is the sample code how we I approached it when I hardcoded

<telerik:RadGridView.RowStyle>
                                       <Style TargetType="telerik:GridViewRow">
                                           <Setter Property="Background" Value="{Binding Status,Converter={StaticResource rowcolorConveter}}"></Setter>
                                           <Setter Property="Background" >
                                               <Setter.Value>
                                                   <MultiBinding Converter="{StaticResource ABCConveter}">
                                                       <Binding Path="abc"/>//Hardcode Column Name
                                                       <Binding Path="DataContext.SelectedView" RelativeSource="{RelativeSource AncestorType={x:Type UserControl}}"/>
                                                   </MultiBinding>
                                               </Setter.Value>
                                           </Setter>
                                           
                                       </Style>
                                   </telerik:RadGridView.RowStyle>


If u observe I hardcode the "abc" value while binding.I want to pull this hardcode colum name from from resx file and get the value of the column.



1 Answer, 1 is accepted

Sort by
0
Maya
Telerik team
answered on 17 Jun 2013, 10:22 AM
Hi Arun,

One way to go would be to work with RowStyleSelector instead and handle the logic inside SelectStyle method. Depending on the way you localize your application, you can try to work with the Key for the column header that is declared in the Resource file.

Regards,
Maya
Telerik

Explore the entire Telerik portfolio by downloading Telerik DevCraft Ultimate.

Tags
GridView
Asked by
Arun
Top achievements
Rank 1
Answers by
Maya
Telerik team
Share this question
or