문제

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

도움이 되었습니까?

해결책

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.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top