문제

I have a telerik WPF RadGridView in which I have localized most text strings, but when grouping on a boolean field, it shows true/false, I want to localize these values as well, but I can't figure out how. See image below for an illustration.

To localize the other strings, I am using a resx file with the keys found at http://www.telerik.com/help/wpf/gridview-localization2.html.

edit: I have also set the Language property of the user control to the appropriate locale

As you can see, headers are displayed with english names

도움이 되었습니까?

해결책

I managed to solve this with a rather nasty workaround, so I'm still looking for a better solution, but if anyone needs this for the future, I solved it like this:

<telerik:GridViewCheckBoxColumn Header="{Binding Resx.Confirmed}" DataMemberBinding="{Binding Confirmed}">
    <telerik:GridViewCheckBoxColumn.GroupHeaderTemplate>
        <DataTemplate>
            <Label>
                <Label.Style>
                    <Style TargetType="{x:Type Label}">
                        <Setter Property="Content" Value="{Binding DataContext.Resx.True, RelativeSource={RelativeSource AncestorType={x:Type UserControl}}}" />
                        <Style.Triggers>
                            <DataTrigger Binding="{Binding Group.Items[0].Confirmed}" Value="False">
                                <Setter Property="Content" Value="{Binding DataContext.Resx.False, RelativeSource={RelativeSource AncestorType={x:Type UserControl}}}" />
                            </DataTrigger>
                        </Style.Triggers>
                    </Style>
                </Label.Style>
            </Label>
        </DataTemplate>
    </telerik:GridViewCheckBoxColumn.GroupHeaderTemplate>
</telerik:GridViewCheckBoxColumn>
라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top