Incremental Search
- 2 minutes to read
ExpressQuantumGrid implements an incremental search functionality allowing a user to locate records in a grid control by matching the initial characters of a record field.
To search a record by a field value, focus on a record cell within the appropriate column and type the search text. If a View contains a record with a value that starts with the search text, the record is focused.
The ‘mi’ characters are pressed. As a result, the first ‘Mickey Alcorn’ record is located. | The ‘l’ character is pressed after ‘mi’ and the focus is moved to the ‘Mildred Johanson’ record |
---|---|
When the first record is located, you can continue searching. To search forward and backward, press the Ctrl+Down Arrow and Ctrl+Up Arrow key combinations respectively.
By default, incremental search is disabled. To enable the facility, set the View’s OptionsBehavior.IncSearch to True. The item’s Options.IncSearch attribute controls whether incremental search can be applied to this item.
The TcxCustomGridTableController class, accessible via the View’s Controller property provides more functionality. It allows you to start the incremental search by specifying the search text, continue and cancel the operation programmatically.
If a user is unable to focus cells within a View because of setting its OptionsSelection.CellSelect property to False, the search item can be specified explicitly using the View’s OptionsBehavior.IncSearchItem property. Note that the property is not in effect if cell selection is enabled (OptionsSelection.CellSelect is True).