Reputation: 100
I have a page with a RadGridView
and some buttons for quickly filtering the RadGridView
data.
When a user clicks one of the buttons, a FilterDescriptor
is added to the view and the filter is applied. If a user clicks "Show New Items only", a filter is applied and new items will be shown.
This is working for all but my boolean checkbox columns. When the filter is applied, no matching items are found. I've tried a number of things, but nothing seems to work.
<telerik:GridViewCheckBoxColumn UniqueName="CorrectiveActionRequired" Header="Corrective Action" IsReadOnly="False" IsEnabled="True" IsFilterable="True"
DataMemberBinding="{Binding CorrectiveActionTaken, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}"
AutoSelectOnEdit="True" EditTriggers="CellClick" />
private void FilterByCorrectiveActionRequired(object sender, MouseButtonEventArgs e)
{
this.NearMissRadGridView.FilterDescriptors.Clear();
FilterDescriptor descriptor = new FilterDescriptor();
descriptor.Member = "CorrectiveActionRequired";
descriptor.Operator = FilterOperator.IsEqualTo;
descriptor.Value = true;
this.NearMissRadGridView.FilterDescriptors.Add(descriptor);
}
Upvotes: 1
Views: 1277
Reputation: 169200
Try to set the Member
property to "CorrectiveActionTaken" which is the actual name of property (I suppose):
private void FilterByCorrectiveActionRequired(object sender, MouseButtonEventArgs e)
{
this.NearMissRadGridView.FilterDescriptors.Clear();
FilterDescriptor descriptor = new FilterDescriptor();
descriptor.Member = "CorrectiveActionTaken"; //<--
descriptor.Operator = FilterOperator.IsEqualTo;
descriptor.Value = true;
this.NearMissRadGridView.FilterDescriptors.Add(descriptor);
}
Upvotes: 1