Incremental Filtering
- 3 minutes to read
The ASPxGridLookup editor enables users to filter built-in ASPxGridView rows dynamically, based upon the text typed into the editor’s input box on the client side (filter-as-you-type). You can set the ASPxGridLookup.IncrementalFilteringMode property to the following filter modes:
None
Filtering is not applied to the editor’s list items (grid rows).
In this mode, only the native filtering of the built-in ASPxGridView control can be used within the dropdown by enabling the GridLookup.GridViewProperties.Settings.ShowFilterRow (ASPxGridViewSettings.ShowFilterRow) property.
StartsWith
A list item (grid row) satisfies the filter only if the text of its specific data field(s) begins with the entered search string. You can customize this string with the ASPxGridLookup.TextFormatString property that defines specific fields, their order, and the field value separator symbol. This mode also includes the autocomplete feature.
The image below illustrates how to filter rows in StartsWith filter mode. The “ana cha“ search string is manually entered into the edit box, and the TextFormatString property is set to “{0} {1}”. This setting specifies that the “First Name” column is searched for “ana“ entries, and the “Last Name” column is searched for “cha“ entries.
Contains
The editor’s drop-down list is filtered for list items (grid rows) that contain the entered search string(s). In this mode, if the entered text does not contain separator symbols (the default separator is a blank space), it is interpreted as a single search string; otherwise, the text is split into parts (separate search strings). To satisfy filter criteria, a list item (grid row) should contain entries of all search strings within data fields specified by the ASPxGridLookup.TextFormatString property. You can also use this property to define custom separator symbols.
The following image illustrates how to filter rows in Contains filter mode. The “ana cha“ text is manually entered into the edit box (which specifies two separate search strings—“ana“ and “cha“), and the TextFormatString property is set to “{0} {1}” (which specifies that the “First Name” and “Last Name” columns should be searched for entries containing these search strings, respectively).
In incremental filtering mode, you can use the ASPxGridLookup.IncrementalFilteringDelay property to define the time interval between the time a user starts typing within the editor’s edit box and the time the control applies the filter.
Note
Incremental filtering requirements.
Incremental filtering requires that multiple selection mode is disabled (the ASPxGridLookup.SelectionMode property is not set to Multiple).
Incremental filtering requires that the AutoPostBack property is set to false
.