AutoCompleteBoxPropertiesBase.CustomFiltering Event
Fires before the server-side filtering is executed.
Namespace: DevExpress.Web
Assembly: DevExpress.Web.v24.1.dll
NuGet Package: DevExpress.Web
Declaration
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 the filter string. |
FilterExpression | Specifies the filter expression. |
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 ASPxAutoCompleteBoxBase.IncrementalFilteringMode is set to None.
- The ASPxAutoCompleteBoxBase.EnableCallbackMode property is set to
false
.
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:
Online Demo
ASPxComboBox - Custom Filtering