Skip to main content

How to: Filter Records

The following example demonstrates how to apply a filter to a column and display the filter expression within the grid’s Title Panel.

<dx:ASPxGridView ID="ASPxGridView1" runat="server" AutoGenerateColumns="False">
    <Columns>
        <dx:GridViewDataTextColumn FieldName="Department" />
        <dx:GridViewDataTextColumn FieldName="Location" />
        <dx:GridViewDataTextColumn FieldName="Budget" />
    </Columns>
    <Settings ShowTitlePanel="true" />
</dx:ASPxGridView>
ASPxGridView1.DataColumns["Department"].Settings.AutoFilterCondition = AutoFilterCondition.EndsWith;
ASPxGridView1.AutoFilterByColumn(ASPxGridView1.Columns["Department"], "development");
ASPxGridView1.SettingsText.Title = ASPxGridView1.FilterExpression;

The image below shows the result:

ASPxGridView_FilterByColumn

See Also