ColumnViewOptionsFind.ParserKind Property
If text entered into the Find Panel contains whitespace, the Panel splits this string into separate logical blocks. The ParserKind setting specifies how these blocks are combined into a search query.
Namespace: DevExpress.XtraGrid.Views.Base
Assembly: DevExpress.XtraGrid.v24.2.dll
NuGet Packages: DevExpress.Win.Grid, DevExpress.Win.Navigation
#Declaration
[DefaultValue(FindPanelParserKind.Default)]
[DXCategory("Data")]
[XtraSerializableProperty]
public virtual FindPanelParserKind ParserKind { get; set; }
#Property Value
Type | Default | Description |
---|---|---|
Find |
Default | A Find |
Available values:
Name | Description |
---|---|
Default | When the Windows When a control’s Parser |
Mixed | Words are combined by the ‘OR’ operator. The operator changes to ‘AND’ if you specify a column name before a search word. The ‘administrator owner Country:Sweden’ string is treated as ‘(administrator OR owner) AND Sweden |
Exact | The exact match. If the entered string contains the space characters, the words are not treated separately. |
And | Words are combined by the ‘AND’ operator. The operator changes to ‘OR’ when you precede a word with the ‘?’ character. The operator changes to ‘NOT’/‘AND NOT’ when you precede a word with the ‘-‘ sign. The ‘?administrator ?Maria Sweden -Owner’ is treated as ‘Sweden AND (administrator OR Maria) AND NOT Owner’ |
Or | Words are combined by the ‘OR’ operator. The operator changes to ‘AND’ when you precede a word with the ‘+’ sign. The ‘administrator Maria +Sweden’ string is treated as the ‘Sweden AND (administrator OR Maria)’ query. |
Custom | Allows you to implement a custom parser by handling a control’s Parse |
#Property Paths
You can access this nested property as listed below:
Object Type | Path to Parser |
---|---|
Column |
|
#Remarks
The ParserKind property accepts the following values (run the “Find Panel” Demo Center module to test these modes).
FindPanelParserKind.Default - inherits the global WindowsFormsSettings.FindPanelParserKind property value.
FindPanelParserKind.Mixed - the legacy mode that was the only available option before version 19.1, when the ParserKind property was introduced. Combines the logical parts of the entered string with the “OR” operator. In the figure below, the “administrator Sweden“ search string is transformed into the “administrator OR Sweden“ query: Grid highlights all rows that have either “administrator“ or “Sweden“.
If a user adds column names to the search syntax, the operator changes to “AND”. For example, both the ““Contact Title”:administrator Sweden“ and “administrator Country:Sweden“ strings are parsed as the “administrator AND Sweden“ query.FindPanelParserKind.Or - uses the “OR” operator to build a search query. Unlike the Mixed mode, does not switch to the “AND” operator when users add column names.
The operator changes to “AND” only when a user explicitly adds the “+” sign. In the figure below, the “administrator Maria +Sweden“ string is treated as the “(administrator AND Sweden) OR (Maria AND Sweden)“ query.FindPanelParserKind.And - uses the “AND” operator to build a search query.
Users can add the “?” character to force the “OR” operator. In the figure below, the “?administrator ?Maria Sweden“ string is translated as “Sweden AND (administrator OR Maria)“.FindPanelParserKind.Exact - ignores whitespaces; Data Grid looks up the entire string entered in the Find Panel as if it is a whole word.
FindPanelParserKind.Custom - handle the ColumnView.ParseFindPanelText event to provide a custom Find Panel logic.