I have an UltraWinGrid with a filter row at the top. Some string colums have a dropdown with filters.
On BeforeRowFilterDropDown I have the following code:
if (typeof(string) == e.Column.DataType){ FilterCondition condition = new FilterCondition(e.Column, FilterComparisionOperator.Match, "^[A-Za-z]");
e.ValueList.ValueListItems.Insert(0, condition, "All"); }
This works fine. The problem is what happens when I select the 'All' filter, and take the focus away from the filter cell after that. The cell text changes from 'All' to the FilterCondition.CompareValue, in this case ^[A-Za-z]. I've found out that this is the ToString from FilterCondition. But how does the cell display text get overwritten in the first place? And what can I do to avoid it? I've tried to inherit FilterCondition and override the ToString, but no luck.
I've also found an internal string displayTextOverride; in ColumnFilter that makes me wonder a bit about what's going on.
Regards,Trond
Hi Trond,
What you are describing here certainly does not seem right. I would have thought that the cell should still display "All" and I can't see any reason why it would change to the ToString of the condition class.
Perhaps what you need to do is derive your own class from FilterCondition and override the ToString method on it. Then you could use that class instead of the base FilterCondition class.
Hi, Mark.
I have tried what you suggest, but as I write, with no luck. I've also tried to set the DisplayStyle of the ValueList to DisplayText.
-Trond
I just tested this out with the code you have here and it works fine for me. The cell displays "All" when I pick that item from the list.
So there must be some other factor at work here. Maybe some property you are setting on the column is causing this behavior. Or, maybe this was a bug and you are using an old version of the controls.
Do you have the latest service release?
How to get the latest service release - Infragistics Community