[Expand]General Information
[Collapse]WinForms Controls
  .NET Core Support
 [Expand]What's Installed
 [Expand]Build an Application
 [Collapse]Controls and Libraries
  [Expand]Forms and User Controls
  [Expand]Messages, Notifications, and Dialogs
  [Expand]Editors and Simple Controls
  [Expand]Ribbon, Bars and Menu
  [Expand]Application UI Manager
  [Expand]Docking Library
  [Collapse]Data Grid
   [Collapse]Get Started With Data Grid and Views
     [Expand]Appearance and Conditional Formatting
     [Expand]Data Editing
     [Expand]Hit Information
     [Expand]Data Binding and Working with Columns
     [Expand]Grid View - Columns, Rows and Cells
     [Expand]Banded Views
     [Expand]WinExplorer View
     [Expand]Tile View
     [Collapse]Filter and Search
       Tutorial: Column Filter Dropdowns
       Tutorial: Data Filtering Basics and Filter Panel Settings
       Tutorial: Excel-Style Custom Filter Dialog
       Tutorial: Filter Editor
       Tutorial: Filter Row
       Tutorial: Filtering and Locating Rows API
       Tutorial: Incremental Search
       Tutorial: Search/Find Panel
     [Expand]Split Presentation
     [Expand]Row Preview Sections
   [Expand]Data Binding
    Unbound Columns
   [Expand]Data Editing and Validation
   [Expand]Filter and Search
   [Expand]Focus and Selection Handling
    Format Cell Values
   [Expand]Master-Detail Relationships
   [Expand]Asynchronous Image Load
   [Expand]Export and Printing
   [Expand]Appearance and Conditional Formatting
    Split Presentation
    Row Preview Sections
   [Expand]Batch Modifications
    Hit Information
    Popup Menus
   [Expand]Save and Restore Layout
   [Expand]Visual Elements
   [Expand]Design-Time Features
   [Expand]End-User Capabilities
    Included Components
  [Expand]Vertical Grid
  [Expand]Property Grid
  [Expand]Pivot Grid
  [Expand]Tree List
  [Expand]Gantt Control
  [Expand]Chart Control
  [Expand]Map Control
  [Expand]Rich Text Editor
  [Expand]Spell Checker
  [Expand]Form Layout Managers
  [Expand]Navigation Controls
  [Expand]PDF Viewer
  [Expand]TreeMap Control
  [Expand]Sunburst Control
 [Expand]Common Features
  Get More Help
 [Expand]API Reference
[Expand]ASP.NET Controls and MVC Extensions
[Expand]ASP.NET Bootstrap Controls
[Expand]ASP.NET Core Bootstrap Controls
[Expand]WPF Controls
[Expand]Xamarin Controls
[Expand]Windows 10 App Controls
[Expand]Office File API
[Expand]Report and Dashboard Server
[Expand]eXpressApp Framework
[Expand]eXpress Persistent Objects
[Expand]CodeRush Classic
[Expand]Cross-Platform Core Libraries
[Expand]Tools and Utilities
 End-User Documentation
View this topic on docs.devexpress.com (Learn more)

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.

Expanded 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.

Expanded 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.

Expanded 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.

Expanded Preventing End-Users from Activating the Filter Row

To prevent the auto-filter row from being invoked using the column header context menu, expand the View's GridView.OptionsMenu property and disable the GridOptionsMenu.ShowAutoFilterRowItem option.

Run the application and click any column header to see that the context menu doesn't contain the Show Auto Filter Row item anymore.

Expanded Activating the Filter Row at Design Time

Expand the View's GridView.OptionsView property and enable the GridOptionsView.ShowAutoFilterRow option.

Run the application again to see the auto-filter displayed at the top of the View. It is enabled at application startup now and cannot be hidden by end-users using the context menu.

Expanded Changing the Comparison Operator for Filter Conditions

The grid also allows you to manually specify the comparison operator for filter conditions. Close the application and change the comparison operator for the Name column. Expand the column's GridColumn.OptionsFilter property and set the OptionsColumnFilter.AutoFilterCondition setting to AutoFilterCondition.Contains.

If you filter the grid now, it will display records whose values contain the entered string at any position.

Note that for columns that use a LookUpEdit, ImageComboBoxEdit or CheckEdit editor, the comparison operator cannot be changed.

Expanded 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.

Expanded Disabling the Filter Row for Individual Columns

Now disable the filter row's functionality for the Name column by setting the OptionsColumnFilter.AllowAutoFilter property to false.

As a result, the auto filter row's cell for the Name column is now disabled, but you can still use this row to filter data against other columns.

Expanded See Also

Is this topic helpful?​​​​​​​