Hi everyone!
I use a Version 2015.1.401.40 GridView to show entries with a bool value. I want to show only entries with the bool value 'false', but keep the possibility to look at the other entries too.
So I created a Behavior for the GridView:
private RadGridView Grid { get => AssociatedObject as RadGridView; } protected override void OnAttached() { base.OnAttached(); Grid.DistinctValuesLoading += Grid_DistinctValuesLoading; Grid.FilterOperatorsLoading += Grid_FilterOperatorsLoading; } private void Grid_DistinctValuesLoading(object sender, GridViewDistinctValuesLoadingEventArgs e) { e.ItemsSource = new List<bool>() { true, false }; } private void Grid_FilterOperatorsLoading(object sender, FilterOperatorsLoadingEventArgs e) { IColumnFilterDescriptor okFilter = Grid.Columns["IsStandinSetupOK"].ColumnFilterDescriptor; okFilter.SuspendNotifications(); okFilter.DistinctFilter.AddDistinctValue(false); okFilter.ResumeNotifications(); }
And as expected only entries with the IsStandinSetupOK value 'false' are shown. But that filter is not indicated by the Icon, and the filter menu looks like there is no filter active (see screenshot). Even clicking 'Clear Filter' does nothing, to remove the filter I have to activate either the true or false filter first, THEN click 'Clear Filter'.
The GridView is filled with entries only after the filter was applied.
Any idea what I did wrong?
Best regards,
Stefan
