I know I've asked the exact same question here (Override default Boolean Filtering in GridView WPF, Apply Custom bool filter) BUT the result wasn't the one expected. In fact, the checkbox should be the "default" one from the DatagridView and not the "checkbox" item. They are not the same.
This code provide a checkbox item:
<telerik:GridViewDataColumn Header="Intégrée" UniqueName="Intégrée" DataMemberBinding="{Binding IsIntegree, Converter={StaticResource MyConverter}}" ShowDistinctFilters="True">
<telerik:GridViewDataColumn.CellTemplate>
<DataTemplate>
<CheckBox IsChecked="{Binding IsIntegree, Mode=TwoWay}"/>
</DataTemplate>
</telerik:GridViewDataColumn.CellTemplate>
This one provide a checkbox from the GridViewDataColumn with "ThreeState". The view result aren't the same.
<telerik:GridViewDataColumn Header="Intégrée" DataMemberBinding="{Binding IsIntegree, Mode=OneWay}" ShowDistinctFilters="True"/>
In the code behind I did change the output inside the filter BUT there is no more Binding from the string value ("Vrai") to the booleans values in rows ("True"):
private void GridView_DistinctValuesLoading(object sender, GridViewDistinctValuesLoadingEventArgs e)
{
var col = ((Telerik.Windows.Controls.RadGridView)sender).GetDistinctValues(e.Column, false);
IEnumerable<string> enu = col.Cast<bool>().Select(t => t.ToString());
ICollection<string> distinctValues = enu.ToList();
distinctValues.Clear();
distinctValues.Add("Vrai");
distinctValues.Add("Faux");
e.ItemsSource = distinctValues;
}
How can I bind the String value to the boolean value in rows to Filter my rows ?