One of the columns of my UltraGrid uses a ValueList from int to string to display the record label on the screen for the related id as integer.
A record has the label "0830 (0800)". When I enter "08" in the filter of that column, that row is filtered out. The tooltip on the filter cell displays "Contains '8'".
I changed the column.FilterComparisonStyle to DisplayTextOnly, but this behavior is still the same.
My goal is to filter only for the DisplayText and ignore the values of the ValueList.
How can I accomplish this?
Hi Burak,
I'm confused. I have attached here the sample I have been using to test this. In my sample, there's an item in the ValueList with text: "0830 (0800)" - which is the text you used in your original post.
So if I understand you correctly, you are saying that using the latest workaround I posted, if you type an "8" into the filter cell, it doesn't work and cells that contain "0830 (0800)" are filtered out when they should not be.
But I tried this out with my sample and it works fine. So what am I missing here?
4812.WindowsFormsApplication49.zip
Hi Mike,
Sorry for providing you with incomplete information.
The cells that contain "0830 (0800)" aren't filtered out. They are kept on the grid, which is expected behavior.
The problem is that there are other cells that contain the char '8', but not the string '08'. They are displayed as well when they should be filtered out.
Example: a cell that contains 'abc 8:45' isn't filtered out when I type in '08' in the filter cell. In this case the filter query reads as "contains '8'".
Oh, I see. That makes sense, since the filter cell will convert "08" into a numeric value of 8 and thus lose the 0. So I guess that third workaround is no good and you will need to use one of the other two. Sorry for the confusion, I never thought about leading zeroes.
No problems. Thank you for the tip anyway!