Hi all,
I have a xamGrid where one of the columns contains value from enum. For example, I have an enum Gender with values F and M. To make my grid more user friendly, new converter was introduced to convert values M and F to Male and Female correspondingly. But in Custom Filter window I still see F and M values instead of Female and Male. Both methods Convert and Convert back are implemented correctly.
How can I change displaying of these values in Custom Filter?
Hi Alexander,
Unfortunately the custom filter dialog and even the filter menu only look at the actual value of the cell, not the converted value. There is a way to control this but it only works with ComboBox columns as this is the most likely column type that would need this feature. The ComboBox column has a FilterMenuItemConverter property that you can set and this will allow you to change the text displayed inside the FilterMenu and I think that should include the Custom Filter dialog.
http://help.infragistics.com/doc/WPF/2015.2/CLR4.0/?page=InfragisticsWPF4.Controls.Grids.XamGrid.v15.2~Infragistics.Controls.Grids.ComboBoxColumnBase~FilterMenuItemConverter.html
The simplest solution though, to me at least, would be to just change your enum to say Male or Female.
Thank you, Rob.
It seems I have to come up with something like you suggested.
Hi Alex,
I suppose what you could do is use the ComboBoxColumn but instead provide your own CellControl style that you can then place your own display control and edit control into if you don't want to use a ComboBox to display your Male and Female choices (actually it might be nice to display those options in a ComboBox).
You can find the default style for the CellControl in the Infragistics installation directory: C:\Program Files (x86)\Infragistics\2016.1\WPF\DefaultStyles\XamGrid. Search for "ig:CellControl" and the style should come up.