I am overriding the FilteringControl to remove IsContainedIn and IsNotContainedIn. My code looks like this:
The base.Prepare call is firing a collection changed event if actions are removed, and this is causing an unwanted refresh of the grid every time the filter control is opened by the user. If I have a custom filter control, but do not remove actions, then the collection changed event is not fired, so the removal of actions seems to be the reason why the event is triggered.
I do not want the collection changed event to fire, or I need a way to know that the event was fired by the Prepare. Is there a way to prevent this event from firing?
Thanks for your help.
public
class
StringFilteringControl : FilteringControl
{
public
override
void
Prepare(GridViewBoundColumnBase column)
{
base
.Prepare(column); // <-- This fires OnCollectionChanged if actions are removed
var vm =
this
.DataContext
as
FilteringViewModel;
if
(vm !=
null
)
{
vm.AvailableActions.Remove(FilterOperator.IsContainedIn);
vm.AvailableActions.Remove(FilterOperator.IsNotContainedIn);
}
}
}
The base.Prepare call is firing a collection changed event if actions are removed, and this is causing an unwanted refresh of the grid every time the filter control is opened by the user. If I have a custom filter control, but do not remove actions, then the collection changed event is not fired, so the removal of actions seems to be the reason why the event is triggered.
I do not want the collection changed event to fire, or I need a way to know that the event was fired by the Prepare. Is there a way to prevent this event from firing?
Thanks for your help.