Data Filtering

Filtering is an essential requirement for most software applications. The XtraGrid Suite is packed with numerous filtering features so that you can deliver a solution that best meets your customer's requirements.

Microsoft Excel Style Filter Dropdowns

The simplest end-user filtering tasks can be accomplished using Filter Dropdown Lists. These lists mimic the filtering UI implemented in Microsoft Excel. Like spreadsheets, Grid Views can display Filter Buttons within column headers. These buttons provide access to filter dropdown lists that contain unique values from corresponding columns. You simply select the desired value and the View will display only those records that match the specified value.

Unlike Excel, however, you won't see filter buttons by default. We have improved this UI by introducing Filter Smart Tags. When Smart Tags are enabled, filter elements are not displayed within a column header until it is hot-tracked. Once a header is hot-tracked, a small Smart Tag becomes visible. It provides access to the same familiar filter dropdown list like that in Microsoft Excel.

By default, the XtraGrid uses Smart Tags rather than Filter Buttons, since Smart Tags do not occupy as much space and thus make column captions more readable. But if you don't have column caption readability problems or simply prefer the classic Filter Button, you simply need to toggle a single option to make everything look exactly like that in Excel.

One more enhancement we've made to Filter Dropdowns is the ability to display most recently used items. If this feature is enabled, the values you selected last are displayed at the top of the list. This reduces the amount of scrolling needed for commonly used filter conditions.

Windows Vista Style Filtering for Date-Time Columns

You can easily filter data (date-time columns) using a Windows Vista style dropdown window. Note that end-users can easily select multiple dates, month or years by using drag and drop.

Custom filter conditions are also allowed. You can populate the list below the calendar with any criteria you need, for instance "Last Fiscal Year". Note that if you do so, end-users will see the information about the actual start and end dates in the filter item's hint, without you having to write any code.

Microsoft Excel Style Filter Dialogs

As you've probably noticed, the Filter Dropdown contains four service items at the top of the list. (Custom) deserves special attention since it invokes a Custom AutoFilter dialog that offers you extended filter condition customization. With it, you can apply up to two filter conditions to each column and join these conditions using either AND or OR logical operators.

By toggling a single option you can enable an even more flexible Custom Filter dialog. With this advanced dialog, you can specify a filter by comparing values from different fields.

You are not limited to the predefined item set within Filter Dropdowns or to the built-in Filter Dialogs. You are free to populate dropdown lists with your own items or substitute default filter dialogs with custom dialogs.

Auto-Filter Row

The Auto-Filter row is displayed above all other rows and allows end users to filter data by entering the filter values within its cells. This row uses the same editors as that assigned to a given column which makes data filtering much easier. You can also specify whether filtering should be applied immediately after changing a value or only when end-users press the ENTER key. An additional enhancement is the ability to filter records using the LIKE operator so that users need only enter the first few characters of their search criteria.

Filter Panel

The Filter Panel is displayed at a View's bottom-most edge. This is a multi-functional panel that offers you the following benefits:

  • It displays the currently applied filter condition.
  • It allows you to clear the currently applied filter condition - simply press the panel's Close button.
  • It enables you to temporarily disable the currently applied filter by using the built-in check box.
  • It provides a most recently used filter condition list. This is especially useful if you need to switch between two or three filter conditions all the time. In such instances, you won't have to construct your conditions again and again - simply choose a previously specified filter criteria from the list.
  • It allows you to invoke the Advanced Filter Editor described in the following section.

Advanced Filter Editor Dialog

If you need total control over the filter condition, use our industry-leading Filter Editor dialog. With this dialog, you will be able to build filter criteria of any complexity - create any number of conditions and combine them in any manner using any logical operator.

The new filter editor is available to end-users via the Edit Filter button located within the Filter Panel. This button is enabled by default, but can be suppressed if you wish.

Custom Filtering

There may be instances wherein you need to hide certain records or make them visible in a grid's View regardless of the applied filter criteria. In such instances, you can handle a single XtraGrid event to manually control record visibility.

Card View Notes

Almost all data filtering functionality desribed above is also available to Card View users. There are a few differences to be noted:

  • Auto-Filter Row is not available in Card Views;
  • Microsoft Excel style filtering is available via the Customize button - not via field captions like in Grid Views.

Learn more: Video: Applying Filters | Video: Custom Filter Dialog | Help Topic: Filtering Overviews | Examples: Data Filtering

LIVE CHAT

Chat is one of the many ways you can contact members of the DevExpress Team.
We are available Monday-Friday between 7:30am and 4:30pm Pacific Time.

If you need additional product information, write to us at info@devexpress.com or call us at +1 (818) 844-3383

FOLLOW US

DevExpress engineers feature-complete Presentation Controls, IDE Productivity Tools, Business Application Frameworks, and Reporting Systems for Visual Studio, along with high-performance HTML JS Mobile Frameworks for developers targeting iOS, Android and Windows Phone. Whether using WPF, Silverlight, ASP.NET, WinForms, HTML5 or Windows 8, DevExpress tools help you build and deliver your best in the shortest time possible.

Copyright © 1998-2014 Developer Express Inc.
All trademarks or registered trademarks are property of their respective owners