Question

I have a filtering row in my xceed datagrid. There are around 8 columns. The user can enter the filter criteria for each column.

Now what I want to do is reset the whole filter using a single button.

Any ideas would be appreciated

Was it helpful?

Solution

Okay I figured it out. I simply created a command ClearFilterCommand in my ViewModel whose execute method is ClearFilter

private void ClearFilter (object obj)
{
  if (obj != null && obj is DataGridControl)
    DataGridCommands.ClearFilter.Execute (null, obj as DataGridControl);
}

<Button Content="Clear Grid Filter" Command="{Binding ClearFilterCommand}" CommandParameter="{Binding ElementName=xceedgrid}"/>

xceedgrid is the name of my xceed DataGrid in the xaml.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top