Skip to main content

ASPxClientGridView.AutoFilterByColumn(column, val) Method

Applies a filter to the specified data column.

Declaration

AutoFilterByColumn(
    column: ASPxClientGridViewColumn | number | string,
    val: string
): void

Parameters

Name Type Description
column string | number | ASPxClientGridViewColumn

The data column | The column’s index | The column’s fieldName

val string

A filter expression.

Remarks

Users can apply a filter via the Filter Row which is displayed if the ASPxGridViewSettings.ShowFilterRow property is set to true.

To learn more, see Filtering.

Example

The following example demonstrates how to use a text string from an external text box to filter a grid column on the client:

View Example: How to apply a filter to a column on the client side

<dx:ASPxTextBox ID="txtFilter" ClientInstanceName="txtClientFilter" runat="server" ... />
<dx:ASPxButton ID="btnFilter" ClientInstanceName="btnFilter" runat="server" Text="Filter by Category Name"
    AutoPostBack="false" ... />
    <ClientSideEvents Click="function(s, e) {
        grid.AutoFilterByColumn('CategoryName', txtClientFilter.GetValue());
    }" />
</dx:ASPxButton>
<dx:ASPxGridView ID="grid" ClientInstanceName="grid" runat="server" AutoGenerateColumns="False" ...>
    <Columns>
        <dx:GridViewDataTextColumn FieldName="CategoryID" ReadOnly="True" VisibleIndex="0">
            <EditFormSettings Visible="False" />
        </dx:GridViewDataTextColumn>
        <!-- ... -->
    </Columns>
</dx:ASPxGridView>
See Also