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

GridView localization for True/False popup filter?

2 Answers 146 Views
GridView
This is a migrated thread and some comments may be shown as answers.
Michael
Top achievements
Rank 1
Michael asked on 18 Jul 2018, 05:57 AM
Hi! I have .resx file with localization strings for GridView filter. When I set FilteringMode in "FilterRow" mode, I see right values for True/False (column binded to boolean property), but when I use "Popup" mode - localization don't work. Is there another resourses I must localize? Example pictures attached.

2 Answers, 1 is accepted

Sort by
0
Accepted
Stefan
Telerik team
answered on 19 Jul 2018, 01:39 PM
Hi Michael,

The FilteringControl of the column will be populated based on the value of the property bound to the DataMemberBinding one. So, in order to alter its default appearance you can define an IValueConverter for the DataMemberBinding.  You can take a look at the code snippet below.
public class BooleanToStringConverter : IValueConverter
    {
        public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
        {
            var boolValue = (bool) value;
            return boolValue ? "Да" : "Нет";
        }
  
       public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
        {
            throw new NotImplementedException();
        }
    }

I hope this helps, Michael.

Regards,
Stefan
Progress Telerik
Want to extend the target reach of your WPF applications, leveraging iOS, Android, and UWP? Try UI for Xamarin, a suite of polished and feature-rich components for the Xamarin framework, which allow you to write beautiful native mobile apps using a single shared C# codebase.
0
Michael
Top achievements
Rank 1
answered on 19 Jul 2018, 02:29 PM
Obviously! Thanks a lot! Works like a charm.
Tags
GridView
Asked by
Michael
Top achievements
Rank 1
Answers by
Stefan
Telerik team
Michael
Top achievements
Rank 1
Share this question
or