I'm trying to make built-in filtering work with a comboboxcolumn.
My GridView is bound to an ObservableCollection of Racer entities.
Each Racer entity has a BikeID property (of type Guid) and a Bike navigation property (of type Bike).
My ViewModel has a class BikeService which has an Items Collection of ComboItemViewModel,
which in turn has "ID" and "Description" public properties.
The following code seems to be working, except for the distinct values part of the filtering control.
Basically, I get an exception for each distinct value because the filtering control is trying to parse
them as Guid, even if I instructed the GridView to filter on Bike.Description, which is a string.
System.Windows.Data Error: 17 : Cannot get 'ConvertedValue' value (type 'Object') from ''
(type 'DistinctValueViewModel'). BindingExpression:Path=ConvertedValue; DataItem='DistinctValueViewModel'
(HashCode=52842714); target element is 'CheckBox' (Name=''); target property is 'Content' (type 'Object')
Eccezione generata dalla destinazione di una chiamata. --->
System.FormatException: Il GUID deve contenere 32 cifre, separate da quattro trattini (xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx).
I opened that sample project, and it shows the same behavior/bug. If you don't specify the FilterMemberPath, it will correctly convert the distinct values but you won't be able to use the filter operators, because they still expect an int value. If you use FilterMemberPath as I did, the filter operators work but the distinct values don't because the filtering control expects them to be int (Guids in my case). I'd like to be able to use both the distinct values checkboxes and the filter operators.
answered on 28 Jun 2012, 03:05 PM
Would it be possible for you to isolate the problem you have in a demo project so that we could debug it locally?
All the best,
the Telerik team
Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get it now >>
Was this every looked at further? I see they same issue. When using the built-in filtering for the ComboBoxColumn the check list appears and works correctly off the ItemSources display field DisplayMemberPath, but specifying a filter using the operators at the bottom of the filter menu still works off the DataMemberBinding field of the Grid's source or SelectedValueMemberPath field which is usually a numeric value.
answered on 05 Oct 2012, 01:43 PM
Filtering can only be and is always performed on the actual raw data values. The DisplayMemberPath is for display purposes only and cannot be filtered on, since it does not participate in the actual data values.
In the distinct values list, the DisplayMemberPath is what you see on the surface because it is human-friendly, but when you click a distinct value it is the raw numeric value is used for filtering which is done with a LINQ Where query on the source collection.