We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date

Resource key query for DataGrid translation

Hello

I'm working on a SfDataGrid, I did the translation as it is at https://help.syncfusion.com/wpf/datagrid/localization, but two items I don't know what is the translation key. Note that resource image has the key "SelectAll", which translating to Portuguese is "Selecionar todos". But I need the key to translate "True" and "False", according to the filter image of SfDataGrid. I looked for the key in the documentation and couldn't find it. Could you let me know?

Attachment: localization_2d46961c.rar

1 Reply

MA Mohanram Anbukkarasu Syncfusion Team October 11, 2019 03:00 AM

Hi Tech Shop,   
  
Thanks for contacting Syncfusion support.   
  
We have checked the reported scenario and it is not possible to provide key to translate the strings True and False. However, you can change the text displayed in the filter control as per your requirement by setting CheckBoxFilterControl.ItemTemplate as given in the below code example.   
  
Code example:    
  
<syncfusion:GridCheckBoxColumn.FilterPopupStyle>   
                                <Style TargetType="syncfusion:GridFilterControl">   
                                    <Setter Property="CheckboxFilterStyle">   
                                        <Setter.Value>   
                                            <StyleTargetType="syncfusion:CheckboxFilterControl">   
                                                <Setter Property="Background"Value="Red"/>   
                                                <Setter Property="ItemTemplate">   
                                                    <Setter.Value>   
                                                        <DataTemplate>   
                                                            <CheckBox Margin="4"   
            HorizontalAlignment="Stretch"   
            HorizontalContentAlignment="Stretch"   
            Focusable="False"   
            Content="{Binding Converter={StaticResource boolConverter}}"             
            FontWeight="{Binding FontWeight,RelativeSource={RelativeSource Self}}"   
            Foreground="{Binding Foreground,RelativeSource={RelativeSource Self}}"   
            IsChecked="{Binding IsSelected,   
                                Mode=TwoWay}">   
                                                            </CheckBox>   
                                                        </DataTemplate>   
                                                    </Setter.Value>   
                                                </Setter>   
                                            </Style>   
                                        </Setter.Value>   
                                    </Setter>   
                                </Style>   
                            </syncfusion:GridCheckBoxColumn.FilterPopupStyle>   
   
   
   
public class BoolConverter : IValueConverter   
{   
    public object Convert(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture)   
    {   
        if ((value as FilterElement).DisplayText == "True")   
            return "Yes";   
        else   
            return "No";   
           
    }   
   
    public object ConvertBack(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture)   
    {   
        return null;   
    }   
}   
  


 
 
We have prepared a sample for your reference and it is available in the below link.   
  
  
Please let us know if you need further assistance from us.   
  
Regards,   
Mohanram A  



Loader.
Live Chat Icon For mobile
Up arrow icon