Maciej Małek
Maciej Małek

Reputation: 29

How to filter GridView data by eg. second or tenth character, DevExpress Winforms?

I need to add custom filter which will filter data in the column by eg second character.

Example:
Values in column: ABCD, DEFG, ABAB, DAAC.
Filter: first letter any, second = 'B'
After filtering I want to see only ABCD & ABAB.

DevExpress allows to create custom filters but I can't see something like this.
Maybe someone had a similar problem in the past?

Upvotes: 0

Views: 835

Answers (1)

Marko Juvančič
Marko Juvančič

Reputation: 5890

Use ActiveFilterString property.

 mygridview.ActiveFilterString = "[MyColumn] LIKE '_B%'";

This says: start with any letter, the second one must be a B, follwerd by any string.

More about filtering.

Upvotes: 2

Related Questions