Skip to main content
A newer version of this page is available. .

ASPxFilterControl Class

Represents a filter control.

Namespace: DevExpress.Web

Assembly: DevExpress.Web.v20.2.dll


public class ASPxFilterControl :

The following members accept/return ASPxFilterControl objects:


The ASPxFilterControl is a stand-alone control that allows end-users to build filter criteria. It does not require any SQL syntax and doesn’t have any limitations regarding filter condition complexity. With the ASPxFilterControl, you can construct any number of filter conditions, combined by any logical operator, and apply them to controls or to a data source.



The ASPxFilterControl isn’t designed to operate with the bound source control. To enable end-users to construct filter criteria, you should manually create filter columns and add them to the ASPxFilterControl.Columns collection. The ASPxFilterControl provides eight column types (text, spin, combobox columns, etc.). The image below shows how to create filter columns at design time:


The example below demonstrates how to create a filter column in code:

private void CreateSpinEditColumn(ASPxFilterControl filterControl, string propertyName, 
    string displayName) {
    FilterControlSpinEditColumn filterColumn = new FilterControlSpinEditColumn();
    filterColumn.PropertyName = propertyName;
    filterColumn.DisplayName = displayName;

The current filter expression is returned by the ASPxFilterControlBase.FilterExpression property. After the filter expression has been constructed by an end-user, you can apply it to the ASPxFilterControl. To do this, use the server ASPxFilterControlBase.ApplyFilter or client ASPxClientFilterControl.Apply methods.

<dx:ASPxButton runat="server" ID="btnApply" Text="Apply" AutoPostBack="false" 
    <ClientSideEvents Click="function() { filter.Apply(); }" />

Once applied, the filter expression can be obtained via the ASPxFilterControlBase.AppliedFilterExpression property. To apply the filter to a control or data source, handle the ASPxClientFilterControl.Applied event.

<dx:ASPxFilterControl ID="filter" runat="server" ClientInstanceName="filter">
        <dx:FilterControlColumn PropertyName="ProductName"  />
        <dx:FilterControlColumn PropertyName="OrderDate" ColumnType="DateTime"  />
        <dx:FilterControlColumn PropertyName="UnitPrice"  />
     <ClientSideEvents applied="function(s, e) { grid.ApplyFilter(e.filterExpression); }"/>

To reset the current filter expression to a previously applied filter expression, use the ASPxFilterControlBase.ResetFilter or ASPxClientFilterControl.Reset method. This sets the ASPxFilterControlBase.FilterExpression property to the ASPxFilterControlBase.AppliedFilterExpression property’s value.

<dx:ASPxButton runat="server" ID="btnReset" Text="Reset" AutoPostBack="false" 
    <ClientSideEvents Click="function() { filter.Reset(); }" />



The client-side equivalent of this control is represented by the ASPxClientFilterControl object. The control’s client-side API is enabled if the ASPxFilterControl.ClientInstanceName property is defined, or any client event is handled. Available client events can be accessed via the ASPxFilterControl.ClientSideEvents property.

Note that although the ASPxGridView control provides an embedded Filter Control, you can still use a separate ASPxFilterControl, with the ASPxGridView control to provide standalone filter editing.

See Also