Back to Devexpress

ColumnViewOptionsFind.HighlightFindResults Property

windowsforms-devexpress-dot-xtragrid-dot-views-dot-base-dot-columnviewoptionsfind-875bf12b.md

latest4.3 KB
Original Source

ColumnViewOptionsFind.HighlightFindResults Property

Gets or sets whether the search string is highlighted within located records.

Namespace : DevExpress.XtraGrid.Views.Base

Assembly : DevExpress.XtraGrid.v25.2.dll

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

Declaration

csharp
[DefaultValue(true)]
[XtraSerializableProperty]
public virtual bool HighlightFindResults { get; set; }
vb
<DefaultValue(True)>
<XtraSerializableProperty>
Public Overridable Property HighlightFindResults As Boolean

Property Value

TypeDefaultDescription
Booleantrue

true if the search string is highlighted within located records; otherwise, false.

|

Property Paths

You can access this nested property as listed below:

Object TypePath to HighlightFindResults
ColumnView

.OptionsFind .HighlightFindResults

|

Remarks

The following applies to a SearchLookUpEdit control, which represents a control embedding a Grid Control and Find Panel in its dropdown. Options provided by the ColumnViewOptionsFind class are also in effect for the SearchLookUpEdit control and can be accessed via the SearchLookUpEdit.Properties.View.OptionsFind property. Setting the HighlightFindResults option to false is not in effect when the SearchLookUpEdit’s RepositoryItemGridLookUpEditBase.PopupFilterMode property is set to Contains or StartsWith.

The following code snippet (auto-collected from DevExpress Examples) contains a reference to the HighlightFindResults property.

Note

The algorithm used to collect these code examples remains a work in progress. Accordingly, the links and snippets below may produce inaccurate results. If you encounter an issue with code examples below, please use the feedback form on this page to report the issue.

winforms-grid-change-color-of-highlighted-search-results/CS/WindowsApplication3/Main.cs#L27

csharp
GridView view = sender as GridView;
if (view.OptionsFind.HighlightFindResults && !view.FindFilterText.Equals(string.Empty)) {
    DevExpress.XtraGrid.Views.Grid.ViewInfo.GridCellInfo cellInfo = ((DevExpress.XtraGrid.Views.Grid.ViewInfo.GridCellInfo)e.Cell);

winforms-grid-change-color-of-highlighted-search-results/VB/WindowsApplication3/Main.vb#L29

vb
Dim view As GridView = TryCast(sender, GridView)
If view.OptionsFind.HighlightFindResults AndAlso Not view.FindFilterText.Equals(String.Empty) Then
    Dim cellInfo As DevExpress.XtraGrid.Views.Grid.ViewInfo.GridCellInfo = (CType(e.Cell, DevExpress.XtraGrid.Views.Grid.ViewInfo.GridCellInfo))

See Also

FindFilterText

ColumnViewOptionsFind Class

ColumnViewOptionsFind Members

DevExpress.XtraGrid.Views.Base Namespace