Custom filter XtraGridView on AutoFilterRow

Hy, I have an XtraGrid with AutoFilterRow
default filter:

Starts with ([columnName], 'mytext')

but I want to change this to:

[columnName] eg '% mytext%'

without creating a custom filter

I just want to open the grid, write inside FilterRow 'mytext' and Filter LIKE applied to my column

the solution is to catch when the filter is changed to create a string and

gridView1.Columns["myCol"].FilterInfo = mystring;

      

but i don't know how to catch the inserted text

early

+3


source to share


2 answers


To achieve the desired result, you need to change the OptionsColumnFilter.AutoFilterCondition parameter .



+5


source


If you already have this:

Starts with([columnName], 'mytext')

      

You should be able to go to the XtraGrid designer, select Layout and at the bottom of the Grid View you can click the Edit Filter link which will open the Filter Editor.

enter image description here



Change the "Starts With" value to "Contains", which is the same as LIKE.

enter image description here

If that doesn't solve what you are trying to do, the other half of your question was to catch filter events. There are several events in the GridView, and the two you are interested in are FilterEditorCreated

and ShowFilterPopupListBox

.

+3


source







All Articles