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
source to share
To achieve the desired result, you need to change the OptionsColumnFilter.AutoFilterCondition parameter .
source to share
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.
Change the "Starts With" value to "Contains", which is the same as LIKE.
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
.
source to share