Completed
Last Updated: 09 Mar 2015 13:47 by ADMIN
ADMIN
Paul
Created on: 30 Jul 2013 07:17
Category: GridView
Type: Feature Request
1
IMPROVE. RadGridView - Extend it with the following localization string ids: FilterMenuSelectionTrue, FilterMenuSelectionFalse
RADGRIDVIEW Extend it with the following localization string ids:

– RadGridStringId.FilterMenuSelectionTrue
– RadGridStringId.FilterMenuSelectionFalse

Resolution: 
The mentioned strings are not predefined strings within RadGridView. They come from the values of the column being filtered (e.g. if the column is a checkbox column, all values are either True or False). Therefore, to localize them, you need to use a ValueConverter and override the conversion to string:

    this.radGridView1.Columns[3].DataTypeConverter = new MyConverter();

    class MyConverter : BooleanConverter
    {
        public override object ConvertTo(ITypeDescriptorContext context, System.Globalization.CultureInfo culture, object value, Type destinationType)
        {
            if (destinationType == typeof(string))
            {
                if (Object.Equals(value, "True") || (value is bool && (bool)value))
                    return "Yes";

                if (Object.Equals(value, "False") || (value is bool && !(bool)value))
                    return "No";
            }

            return base.ConvertTo(context, culture, value, destinationType);
        }
    }
0 comments