A newer version of this page is available. Switch to the current version.

FilterControl Class

Allows end-users to construct filter criteria, and apply them to controls or to a data source.

Namespace: DevExpress.XtraEditors

Assembly: DevExpress.XtraEditors.v18.2.dll

Declaration

[Docking(DockingBehavior.Ask)]
[ToolboxBitmap(typeof(ToolboxIconsRootNS), "FilterControl")]
public class FilterControl :
    BaseStyleControl,
    IFilterControl,
    IFilterControlGetModel

The following members accept/return FilterControl objects:

Library Related API Members
Cross-Platform Class Library FilterEditorControl.FilterControl
WinForms Controls FilterControlEventArgs.FilterControl
FilterEditorControl.FilterControl
FilterEditorControl.FilterControl

Remarks

The FilterControl is a visual control that allows end-users to construct complex filter criteria, and apply them to controls or to a data source:

FilterControlClass

The FilterControl can manage data filtering for the following controls and components:

  • GridControl
  • TreeList
  • BindingSource
  • DataTable
  • Any control that implements the DevExpress.XtraEditors.Filtering.IFilteredComponent interface.
  • Any object that implements the System.ComponentModel.IBindingListView interface.

To specify the object to which the Filter Control will supply filter criteria, use the FilterControl.SourceControl property.

NOTE

Note that although the Grid Control provides an embedded Filter Editor, you can still use a separate FilterControl, with the Grid Control to provide standalone filter editing.

After a source control has been assigned to the FilterControl via the FilterControl.SourceControl property, the filter columns and editors used to edit operand values are automatically retrieved from the source control. Filter columns are stored within the FilterControl.FilterColumns collection.

The filter expression built via the FilterControl can be obtained via the FilterControl.FilterCriteria property. This property can also be used to specify filter criteria in code. To get the text string which represents the filter expression, use the FilterControl.FilterString property.

Changes made to the source control’s filter criteria are automatically tracked by the FilterControl. Each time the source control’s filtering settings are modified by a user or in code, the FilterControl automatically reflects the changes. Note that filter criteria built via the FilterControl are not automatically applied to the bound source control. To apply the current filter criteria to the source control, use the FilterControl.ApplyFilter method.

The FilterControl can be used in unbound mode, when it’s not bound to any source control (the FilterControl.SourceControl property is set to null). In this mode, specific columns must be added to the FilterControl.FilterColumns collection manually. An end-user will be able to construct filter criteria using these columns. To get the current filter criteria, use the FilterControl.FilterCriteria property.

See Also