Collection of column filters.

Namespace: Dapfor.Wpf.Filters
Assembly: Dapfor.Wpf (in Dapfor.Wpf.dll) Version: 4.1.0.26317 (4.1.0.26317)

Syntax

C#
public static class FilterFactory
Visual Basic
Public NotInheritable Class FilterFactory
Visual C++
public ref class FilterFactory abstract sealed
F#
[<AbstractClassAttribute>]
[<SealedAttribute>]
type FilterFactory =  class end

Remarks

Filters in Wpf GridControl columns are an addition to the main filtering method using GridControl.Filter property. Users can visually different filtering conditions with various column filters.

A standard way to cancel filtering is to left-click filter icon while holding Shift.

The Dapfor.Wpf.dll library includes a set of predefined filters collected in FilterFactory:

  • CheckBoxFilter displays a lits of values discovered in grid cells in the specified column. Users can choose one or several values from the proposed list. To cancel a filter for this column you may click the crossed filter icon in the upper left corner.
  • ValueListFilter displays a lits of values discovered in grid cells in the specified column. Users can choose a value from the proposed list. To cancel filtering you can click a crossed filter icon in the upper left corner or choose <All>.
  • ComparableValueFilter can be used for all types implementing the IComparable interface. This includes all whole number types (Int32, Byte, ...), with floating comma (Double, Decimal), dates DateTime, TimeSpan, strings (String) and many others.
  • WildcardFilter uses regular expression for row filtering. If the filter does not use wildcards, the following pattern is applied by default: *<filter>*.
  • DateMultiFilter can be used to filter rows by set dates. You can set multiple conditions.

These filters can be set for a column directly in xaml code:

 Copy imageCopy
<Window x:Class="SomeApplication.MainWindow"
       xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
       xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
       Title="MainWindow" 
       xmlns:my="clr-namespace:Dapfor.Wpf.Controls;assembly=Dapfor.Wpf"
       xmlns:filters="clr-namespace:Dapfor.Wpf.Filters;assembly=Dapfor.Wpf">


   <my:GridControl>
       <my:GridControl.Headers>
           <my:Header>
               <my:Header.Columns>
                   <my:Column Id="Status" Title="Status" FilterTemplate="{x:Static filters:FilterFactory.CheckBoxFilter}" FilterAlignment="Stretch"/>
                   <my:Column Id="Established" Title="Established" FilterTemplate="{x:Static filters:FilterFactory.DateMultiFilter}"/>
               </my:Header.Columns>
           </my:Header>
       </my:GridControl.Headers>
   </my:GridControl>
</Window>

It's also possible to set filters programmatically:

 Copy imageCopy
Column column = gridControl1.Headers[0]["Established"];
column.FilterTemplate = FilterFactory.WildcardFilter;

Inheritance Hierarchy

System..::..Object
  Dapfor.Wpf.Filters..::..FilterFactory

See Also