Back to Devexpress

TreeListOptionsFind.ParserKind Property

windowsforms-devexpress-dot-xtratreelist-dot-columns-dot-treelistoptionsfind-f1c6bfc0.md

latest5.1 KB
Original Source

TreeListOptionsFind.ParserKind Property

Gets or sets whether a search query in the Find Panel is treated as a whole, or as separate keywords for a logical conjunction or disjunction.

Namespace : DevExpress.XtraTreeList.Columns

Assembly : DevExpress.XtraTreeList.v25.2.dll

NuGet Packages : DevExpress.Win.Navigation, DevExpress.Win.TreeList

Declaration

csharp
[DefaultValue(FindPanelParserKind.Default)]
[DXCategory("Data")]
[XtraSerializableProperty]
public virtual FindPanelParserKind ParserKind { get; set; }
vb
<DXCategory("Data")>
<DefaultValue(FindPanelParserKind.Default)>
<XtraSerializableProperty>
Public Overridable Property ParserKind As FindPanelParserKind

Property Value

TypeDefaultDescription
FindPanelParserKindDefault

A FindPanelParserKind enumeration value.

|

Available values:

NameDescription
Default

When the WindowsFormsSettings.FindPanelParserKind setting equals Default, this value is interpreted as And. If you set the WindowsFormsSettings.DefaultSettingsCompatibilityMode property to v18_2 or an earlier version, the Default value is interpreted as Mixed.

When a control’s ParserKind property is set to Default, the WindowsFormsSettings.FindPanelParserKind setting specifies the actual behavior for this control.

| | 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(in the Country column)’

| | 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 ParseFindPanelText event.

|

Property Paths

You can access this nested property as listed below:

Object TypePath to ParserKind
TreeList

.OptionsFind .ParserKind

|

Remarks

The ParserKind property accepts the following values. (Run the XtraTreeList demo 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 “manager California“ search string is transformed into the “manager OR California“ query. Tree List highlights all rows that have either “manager“ or “California“.

  • FindPanelParserKind.Or - uses the “OR” operator to build a search query. Unlike Mixed mode, it does not switch to the “AND” operator when users add column names.

  • FindPanelParserKind.And - uses the “AND” operator to build a search query.

  • FindPanelParserKind.Exact - ignores white space; Tree List looks up the entire string entered in the Find Panel as if it is a single word.

  • FindPanelParserKind.Custom - handle the ParseFindPanelText event to provide custom Find Panel logic.

See Also

TreeListOptionsFind Class

TreeListOptionsFind Members

DevExpress.XtraTreeList.Columns Namespace