Tab

ASPxAutoCompleteBoxBase.CustomFiltering Event

Fires before the server-side filtering is executed.

Namespace: DevExpress.Web

Assembly: DevExpress.Web.v20.2.dll

Declaration

public event ListEditCustomFilteringEventHandler CustomFiltering
Public Event CustomFiltering As ListEditCustomFilteringEventHandler

Event Data

The CustomFiltering event's data class is ListEditCustomFilteringEventArgs. The following properties provide information specific to this event:

Property Description
CustomHighlighting Specifies rules according to which the editor highlights the filtered items.
Filter Gets a string that is a filter condition for the editor's items typed by a user.
FilterExpression Gets or sets a value specifying the filter expression that is to be applied to the editor items.

Remarks

Use the CustomFiltering event to implement custom filtering logic. The CustomFiltering event is reraised if items are loaded on a callback when scrolling.

Use the ListEditCustomFilteringEventArgs.FilterExpression property to specify the filter expression based on the Criteria Operator syntax. If the ListEditCustomFilteringEventArgs.FilterExpression property is not specified, the "Contains/Starts with" comparison operator is used by default.

If the ListEditCustomFilteringEventArgs.CustomHighlighting property is not set, the CustomFiltering event highlights the first occurrence of the search text typed in the editor's filtering area (regardless of the ListEditCustomFilteringEventArgs.FilterExpression property). Use the ListEditCustomFilteringEventArgs.CustomHighlighting property to specify the custom highlighting logic. Refer to this property description for more information.

NOTE

The CustomFiltering event is not in effect in the following cases:

The event's FilterExpression argument is not in effect if the combo box is in custom binding mode.

Online Demo

ASPxComboBox - Custom Filtering

Example

The following example illustrates how to use the CustomFiltering event to filter the combo box items by several words through multiple columns.

<dx:ASPxComboBox ID="CmbCustomers" runat="server" Width="100%" DropDownWidth="550"
    DropDownStyle="DropDownList" DataSourceID="CustomersDataSource" ValueField="CustomerID"
    ValueType="System.String" TextFormatString="{0}" EnableCallbackMode="true" IncrementalFilteringMode="Contains"
    OnCustomFiltering="CmbCustomers_CustomFiltering">
    <Columns>
        <dx:ListBoxColumn FieldName="CompanyName" Width="100%" />
        <dx:ListBoxColumn FieldName="Country" Width="70px" />
    </Columns>
</dx:ASPxComboBox>

The result:

ASPxComboBox-CustomFilteringEvent

See Also