To add a quick filter to the header DataGrid, just use the control FilterDataGrid, which differs from the standard DataGrid control only one - in the column header template has already been introduced ColumnFilter:

How use.

<UserControl x:Class="Northwind.NET.Sample.View.EmployeesView"
    <Grid DataContext="{StaticResource EmployeesViewSource}">
        <bsFilter:FilterDataGrid x:Name="employesDataGrid"

How look.


How work.

The control ColumnFilter loading retrieves the bindings for the column in which it is located, and a copy of the collection that is bound to the parent DataGrid through the property ItemsSource. Filter models are formed based on the extracted parameters that are suitable for the column, and displayed in ColumnFilter. If the column binding information are not retrievable, the binding for ColumnFilter indicated by the attached property bsFilter:ColumnFilter.BindingPath="Name_property_of_the_collection_item".

Depending on the type of property, ColumnFilter displays the next set of filters:

Property Type Filters
int, real, long etc. EqualFilter, LessOrEqualFilter, GreaterOrEqualFilter, RangeFilter.
IComparable EqualFilter, LessOrEqualFilter, GreaterOrEqualFilter, RangeFilter.
String EqualFilter, StringFilter.
Bool EqualFilter.
Object EqualFilter.

Inclusion ColumnFilter in the DataGrid and setting its appearance is also available through the style without changing the forms developed.

Last edited Nov 9, 2013 at 3:14 AM by Mishkin, version 8