Is it possible to change the text of the checkboxes that are shown for the distinct filters in the filter popup?
I have a RadGridView where one of the column is of type nullable bool. I have a cell edit template for this column with a RadComboBox that has two options, 'Yes' and 'No', that of course corresponds to True and False. Also I have set ClearSelectionButtonVisibility="Visible" on the RadComboBox so that the user can set the value to null. This works fine.
My problem is that in the filter popup of the column I have dinstict filters with the three available options true, false and null. This also works fine BUT the text of the checkboxes show 'True', 'False' and '' (empty string) respectively. I would like them to show the same as in my ComboBox, that is 'Yes' and 'No' instead.
Is this possible to accomplish, and in that case how?
6 Answers, 1 is accepted
You can use an IValueConverter on the column DataMemberBinding. It will be respected by the distinct values.
Best wishes,Ross
the Telerik team

Thanks Ross! :)


I have the following column:
<telerik:GridViewDataColumn
DataMemberBinding="{Binding ReminderPassed, Mode=OneWay, Converter={StaticResource BoolToColumnFilterTextConverter}}"
x:Name="ReminderIcon"
CellStyle="{StaticResource IncidentListTextEffects}"
Header=""
FilterMemberPath="ReminderPassed"
IsReadOnly="True"
IsVisible="{Binding IsTemplateList, Converter={StaticResource InvertBoolConverter}}"
SortMemberPath="RemindAtLocal" />
Where the converter converts a bool to a string. But my column filter still displays "True" and "False". What am I doing wrong?
Hello Martin,
Thank you for the provided code snippet.
Instead of using IValueConverter, I would suggest creating an additional property that returns the string representation of the ReminderPassed property.
private bool reminderPassed;
public bool ReminderPassed
{
get { return reminderPassed; }
set { reminderPassed = value; this.OnPropertyChanged("ReminderPassed"); }
}
public string ReminderPassed_String
{
get
{
return ReminderPassed.ToString();
}
}
<telerik:GridViewDataColumn
DataMemberBinding="{Binding ReminderPassed_String}"
x:Name="ReminderIcon"
CellStyle="{StaticResource IncidentListTextEffects}"
Header=""
IsReadOnly="True"
IsVisible="{Binding IsTemplateList, Converter={StaticResource InvertBoolConverter}}"
SortMemberPath="RemindAtLocal" />
This way, you will be able to filter the string representation of the ReminderPassed property.
Regards,
Dinko
Progress Telerik
Our thoughts here at Progress are with those affected by the outbreak.
