Back to Devexpress

ColumnView.FindFilterText Property

windowsforms-devexpress-dot-xtragrid-dot-views-dot-base-dot-columnview-cdb4083f.md

latest4.2 KB
Original Source

ColumnView.FindFilterText Property

Gets or sets the query in the Find Panel.

Namespace : DevExpress.XtraGrid.Views.Base

Assembly : DevExpress.XtraGrid.v25.2.dll

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

Declaration

csharp
[Browsable(false)]
[XtraSerializableProperty(1010)]
[XtraSerializablePropertyId(3)]
public string FindFilterText { get; set; }
vb
<Browsable(False)>
<XtraSerializableProperty(1010)>
<XtraSerializablePropertyId(3)>
Public Property FindFilterText As String

Property Value

TypeDescription
String

A String value that specifies the query in the Find Panel.

|

Remarks

Use the FindFilterText property to get the applied search/find query.

Use the ApplyFindFilter(String) and ClearFindFilter() methods to apply and discard a search/filter query in code. See Find Panel Syntax to learn how to build queries.

csharp
// Specify a query.
gridView1.ApplyFindFilter("foo");

// Discard the query.
gridView1.ClearFindFilter();
// You can also pass an empty string
// to discard the query.
gridView1.ApplyFindFilter(String.Empty);
vb
' Specify a query.
GridView1.ApplyFindFilter("foo")

' Discard the query.
GridView1.ClearFindFilter()
' You can also pass an empty string
' to discard the query.
GridView1.ApplyFindFilter(String.Empty)

The following code snippet (auto-collected from DevExpress Examples) contains a reference to the FindFilterText 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-richedit-highlight-search-results/CS/E4422/Form1.cs#L19

csharp
private void OnCustomDrawCell(object sender, DevExpress.XtraGrid.Views.Base.RowCellCustomDrawEventArgs e) {
    if (e.Column == colDescription && !string.IsNullOrEmpty(gridView1.FindFilterText)) {
        server.RtfText = e.DisplayText;

winforms-grid-richedit-highlight-search-results/VB/E4422/Form1.vb#L22

vb
Private Sub OnCustomDrawCell(ByVal sender As Object, ByVal e As DevExpress.XtraGrid.Views.Base.RowCellCustomDrawEventArgs)
    If e.Column Is colDescription AndAlso Not String.IsNullOrEmpty(gridView1.FindFilterText) Then
        server.RtfText = e.DisplayText

See Also

Find Panel

Find Panel Syntax

ColumnView Class

ColumnView Members

DevExpress.XtraGrid.Views.Base Namespace