我有一个包含RadGridView
的页面和一些用于快速过滤RadGridView
数据的按钮。
当用户点击其中一个按钮时,会在视图中添加FilterDescriptor
并应用过滤器。如果用户点击"仅显示新项目",则会应用过滤器并显示新项目。
这适用于除布尔复选框列以外的所有列。应用过滤器时,找不到匹配的项目。我尝试过很多东西,但似乎没什么用。
<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);
}
答案 0 :(得分:1)
尝试将Member
属性设置为&#34; CorrectiveActionTaken&#34;这是属性的实际名称(我想):
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);
}