-1

I am using devexpress 16.1 version, enable autofilter mode using columnheader, when i enter values its filter by begin character, but i want to filter contains, for example , i want to get "manager", i will enter "nage". am tried with this, but while filtering my filter values are empty

 Dim filterstr As String = GridView1.FocusedValue
 GridView1.ActiveFilterString = "Contains([" & HitColumnName & "]" & "," & "'" & filterstr & "'" & ")"

Thanks in Advance

Niranjan Singh
  • 18,017
  • 2
  • 42
  • 75
Shankar
  • 45
  • 8

1 Answers1

0

You can change the filter condition in the OptionsColumn.AutoFilterCondition property for every column in GridView.

I suggest you to go through documentation of XtraGrid Filtering:
Tutorial: Column Filter Dropdowns
Tutorial: Data Filtering Basics and Filter Panel Settings

You can set it in Designer in column properties: enter image description here

and pragmatically as below:

gridView1.Columns[0].OptionsFilter.AutoFilterCondition = DevExpress.XtraGrid.Columns.AutoFilterCondition.Contains; 

References:
XtraGrid - Provide a property to change filtering type from "begins with" to "contains", etc.
How to set filter condition as CONTAINS for AutoFilter row through code at grid level
How to set auto filter row text of specific columns via code

Niranjan Singh
  • 18,017
  • 2
  • 42
  • 75
  • hello niranjan, optioncolumns.autofiltercondition option not with my grid-view, i checked that, is there any solution to achieve the filter option – Shankar Sep 12 '17 at 05:11