This question is locked. New answers and comments are not allowed.
Hello,
I would like to print custom strings in my boolean filter on a DataGridView column. I did succeed in printing my strings but I lost every Binding.
Here is my xaml here
<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; }The list printed in the column is done this way (code behind) :
public DemandeCotationListeView() { InitializeComponent(); DemandeCotationListeViewModel demandeCotationViewModel = new DemandeCotationListeViewModel(); DataContext = demandeCotationViewModel; for (int cpt = 2; cpt < GridView.Columns.Count; cpt++) { GridView.Columns[cpt].FilteringControl = new PersonalizedFilteringControl(GridView.Columns[cpt]); } }How can I bind the String value to the boolean value in rows to Filter my rows ?