WinForms - Data Grid - New Find Panel Options (v19.1 CTP)

WinForms Team Blog
20 March 2019

In the recent CTP blog post we mentioned new functionality for the Find Panel. The CTP is available now to all active Universal and DXperience subscribers and in this post I will describe the new functionality in more detail.

If you have the DevExpress Demo Center installed, open the WinForms Data Grid's Find Panel demo and search for a string like administrator Sweden. If you are using the CTP installation, the Data Grid will find only one match: a Swedish company where the Contact Title contains the text Order Administrator.

In version 18.2 or below, you will see more matches: all administrators, and all Swedish companies.

Old Search Result

What changed? Our search engine handles each word of the Find Panel text separately. Starting with v19.1 CTP, we added an option to specify the operator used to combine search criteria.

In older versions, the Data Grid used the OR operator in most cases, but for certain scenarios it switched to AND automatically (here’s the documentation for that behavior).

The New ParserKind Option

Based on your feedback we decided to simplify this mechanism. We introduced the option OptionsFind.ParserKind which supports several modes:

  • Mixed - this is the legacy mode that makes the search engine behave just like it did in versions up to and including v18.2.
  • Exact - the search engine does not split the search query at word boundaries, thereby searching for exact matches. This behavior was available previously by using quotes around search expressions.

Exact Search

  • Or - search words are combined with the OR operator. It is possible to specify column names as before, but the operator doesn’t change.

Or Search

To explicitly use the AND operator in this mode, a word can be prefixed with a + (plus) character:

Explicit And in Or Search

  • And - search words are combined with the AND operator.

And Search

It is possible to explicitly change the combination operator to OR for individual words by prefixing search words with a ? (question mark) character.

Explicit Or in And Search

  • Custom - in this mode you need to handle the ParseFindPanelText event to control the processes of parsing the search text into a filter expression and highlighting row content in the Data Grid.
  • Default - equal to And for v19.1, and Mixed for the older versions.

The Condition Property

In addition to the ParserKind option we also added the property Condition to specify how individual string values are compared. The settings are self-explanatory: Contains (this is the default), StartsWith, Equals, and Like. Note that Condition is only evaluated when ParserKind != Mixed – again, we want to prevent breaking changes when default settings are used.

Condition

New Global Options

We introduced global options in WindowsFormsSettings which are equivalent to those on the Data Grid itself. They are called FindPanelParserKind and FindPanelCondition. These settings are automatically applied to all Data Grids that have ParserKind or Condition set to Default.

Your Feedback Counts

We believe that the two new options make a large difference to the way end users work with the Find Panel. For v19.1 they are only available for the Data Grid, but depending on your feedback we will consider supporting them for other data-aware controls like the Tree List or the Vertical Grid. Please submit your responses to the short survey below, and feel free to leave comments below or open Support Center tickets for further discussion.

Free DevExpress Products - Get Your Copy Today

The following free DevExpress product offers remain available. Should you have any questions about the free offers below, please submit a ticket via the DevExpress Support Center at your convenience. We'll be happy to follow-up.
No Comments

Please login or register to post comments.