Some of the grid columns in my application need to support a custom list of filters in the filter dropdown. I've attempted to manually add and modify the FilterSelectionControl's generic template and I see where the listbox is being bound to a list of unique values, but since the control uses a proxycollection, I can't simply drop in a converter to modify the values. Even if this was to work, I'd still have to override the method which actually performs the filtering and figure out how to apply this template to just some and not all of the grid's columns.
Can someone please point me in the right direction?
Thanks!
Here's some additional info. What I'm really trying to do is the following. I have a grid with the following info:
When using the filter dropdown, unique values list for available colors contains the following entries:
Red Red, Green, Blue Red, Green, Yellow
I'd like it to contain the entries:
Red Green Blue Yellow
And I'd like to be able to return the Jacket and Blouse rows when I select "Green", for example.
In other words, I need to change both the filter list and the filter behavior for just that one column.
How do I do that?
Hello,
I worked with Raphael on this solution and I am posting the results for completeness.
In order to do this you would define a header style on the Colors column. This header style would be based on the default style for the HeaderCellControl. You would also need to create your own control derived from FilterSelectionControl and use this control in the header style. In the derived control you would then need to override the following
1) SetupselectionBox : This occurs when the filter menu is opened. In this method you would need to create the elements in the Filter Menu List (ie. itemsBox)
2) AcceptChanges: This occurs when the OK button is clicked. You would need to build the filters to use the Contains / DoesNotContain operands instead of the Equals/NotEquals operands
3) GetParameter: This occurs when the Clear Filters command is issued. You can override this method to check if the ClearSelectedItems command was issued, if so, you can execute logic to clear the custom listbox (i.e itemsBox)
I have attached a sample illustrating how to accomplish this.
Sincerely,
Valerie
Developer Support Engineer
Infragistics
www.infragistics.com/support