Tutorial: Filter Row

This walkthrough is a transcript of the Filter Row video available on the DevExpress YouTube Channel.

In this tutorial, you will learn how to activate the auto-filter row and use it to filter data against columns that use different in-place editors.

Activating the Filter Row by End-Users

To activate the auto-filter row, right-click any column header and select the Show Auto Filter Row item in the context menu.

Filtering Data by Typing Text within the Filter Row

When an end-user starts typing within a row, a filter condition is automatically created using the LIKE comparison operator. After typing 'd' in the Name cell, the grid displays records of names that begin with 'd'.

You can then enter additional characters to continue filtering the view. To clear the currently applied filter condition, remove the text from the filter row's cell.

In a similar manner, you can filer data against date-time columns. For instance, type 1 and a forward slash to filter records that have been created in January.

You can also use the auto-filter row to filter data against multiple columns. Enter the 'help' string within the Name column without clearing the previous filter to try it in action.

Then, clear the filter to see all data again.

Using the Filter Row for Columns that Use LookUp, ImageComboBox and CheckEdit Editors

In columns with LookUpEdit, ImageComboBoxEdit or CheckEdit in-place editors, the auto-filter row doesn't allow custom text entry. Auto-filter row cells use the same editors, and the EQUALS operator is used to create filter conditions.

Select the Carl Lucas item in the dropdown list to create and apply an appropriate filter.

To clear filtering against the Owner column, you can press the CTRL+DELETE key combination or select (All) in the column header dropdown.

To filter data against the Priority column with an ImageComboBoxEdit editor assigned, select the desired item in the corresponding dropdown list.

To clear the current filter, select the empty item in the dropdown.

Check boxes in the auto-filter row can be in three states. If you switch the editor's check state to the Checked or Unchecked, the corresponding filter is applied.

To remove the current filter, switch the check box to the Indeterminate state.

Disabling Automatic Updates for Filter Row Conditions

As you've noticed, by default the filter is updated immediately you type in every individual character. With large datasets you may want to enable delayed filtering so that the condition is applied only once after you enter the entire filter string. To do this, open the Property grid displaying the Name column properties and disable the OptionsColumnFilter.ImmediateUpdateAutoFilter option.

Now when you enter text in the auto-filter row within the Name column, the filter is not automatically applied. You need to press the ENTER key or move focus to another cell to force the update.