Hello
I have in the XamGrid a templatecolumn in which a combobox is defined in editor template. The key for this column is an integer.Now I would like to filter (in FilterRow) this column not to the defined key (integer) but to the text displayed in the combobox.Is this possible? If so, how do I define the filter-template for it to work as described above?
Sincerly, Kasar
Apparently this is new to a later version. As I said, I use version 15.2. Here is the code I used to solve this problem:
Add FilterMenuItemConverter="{StaticResource SalesRepIdToFullNameConv}" to the XamGrid.
Added an IValueConverter to the code-behind (not the ViewModel). Of course this IValueConverter will have to have a source of data that it can use to convert the integer Value to a string Value. I had to add a reference to my Models to gain access to a List type that contained the data I needed.
<code> public class SalesRepIdToFullNameConverter : IValueConverter</code>
Of course, I had to add a resource to my Window.Resources to point to the IValueConverter in the code-behind.
Is this new to a later version? I am currently using 15.2. The default behavior I witness for Filtering a ComboBoxColumn is that the Filter displays the SelectedValue values instead of the DisplayMember values.
Let me know how I can get the Filtering (FilterMenu) to display the DisplayMember text.
Hi Kasar,
You should use the ComboBoxColumn for this instead. It has built-in support for the combobox and you can provide a DisplayMemberPath so that it displays the text you want for each combobox item and the filter will automatically use that combobox so users can only select options that exist within the combobox. Naturally the filter will also display the DisplayMemberPath. It also has a SelectedValuePath and you should set this so that when a user chooses an item from the combobox it will set your column key to the SelectedValuePath.