Antiohia
Antiohia

Reputation: 1232

Autofilter by DisplayText in DevExpress

I have a calculated numeric field in a grid. I use a custom editor for it. All filter operations in Filter editor work well but the auto filter row filters according to the value and not the display text. I know that I can set FilterMode to DisplayText but then this is also used for comparisons etc. So, I need to use FilterMode DisplayText for the auto filter, Value for everything else. Is this possible? I have already a lot of code in the custom grid class, so it would be ok to have an additional event handler or another workaround.

EDIT

I store e.g. prices in euro and I display them differently depending on the user's settings. So, e.g. I have stored a value 100 and I need to display "234 abc". When I set FilterMode=DisplayText, I can't compare the actual value with e.g. > and <. Currently, I use FilterMode=Value and I convert the displayed value in the filter editor for filtering. The only problem is with StartsWith i.e. auto filter and with = because of rounding. How could I fix that?

Upvotes: 3

Views: 1128

Answers (1)

Antiohia
Antiohia

Reputation: 1232

I found a solution for my issue... As I have no control on how exactly the values are filtered and I had couple of problems with filtering, I converted my bound columns to unbound columns. I removed the editors making the conversions and replaced them by unbound expressions with custom functions + display format. Not really the solution I was searching for but it works for all kinds of filtering.

Upvotes: 1

Related Questions