This question is locked. New answers and comments are not allowed.
Hello,
I'm having trouble using the GridViewComboBoxColumn and the SortMemberPath. For some reason I always get an System.ArgumentException and there is no other information provided except the exception message that states: "Value does not fall within the expected range". So I'll explain what I'm doing and hopefully somebody notices what I'm doing wrong.
First of all the database layout:
I have a table Employee that has a column EmployeeType. This is a foreign key to a table called OptionDetails that contains all types of employees. (The types must be in a different table to be able to translate each employee type.) In fact OptionDetails also contains types of addresses, different languages, etc. So all the things you could bind to a ComboBox.
So I would like to have a grid that shows me the employee name and its type. Everything works as expected, except for the sorting and grouping. Here's the XAML:
I set the ItemsSource in code behind like this:
The grid is populated OK and every column has the right value filled in.
Now the real issue: When I click on the column header for the employee type column, i get this exception. If I omit the SortMemberPath, than sorting will not throw an exception. Off course everything is sorted then on the EmployeeTypeOptionDetailId, which is not what I want.
Does anyone have any idea? I'm puzzled at the moment that something this trivial is giving me such a headache.
Thanks,
Sodi We
I'm having trouble using the GridViewComboBoxColumn and the SortMemberPath. For some reason I always get an System.ArgumentException and there is no other information provided except the exception message that states: "Value does not fall within the expected range". So I'll explain what I'm doing and hopefully somebody notices what I'm doing wrong.
First of all the database layout:
I have a table Employee that has a column EmployeeType. This is a foreign key to a table called OptionDetails that contains all types of employees. (The types must be in a different table to be able to translate each employee type.) In fact OptionDetails also contains types of addresses, different languages, etc. So all the things you could bind to a ComboBox.
So I would like to have a grid that shows me the employee name and its type. Everything works as expected, except for the sorting and grouping. Here's the XAML:
<telerikGrid:RadGridView x:Name="empList" ItemsSource="{Binding Employees}"> <telerikGrid:RadGridView.Columns> <telerikGrid:GridViewDataColumn DataMemberBinding="{Binding Name}" /> <telerikGrid:GridViewComboBoxColumn UniqueName="empTypesCol" DataMemberBinding="{Binding EmployeeTypeOptionDetailId}" SelectedValueMemberPath="Id" DisplayMemberPath="Description" SortMemberPath="Description" /> </telerikGrid:RadGridView.Columns></telerikGrid:RadGridView>I set the ItemsSource in code behind like this:
((GridViewComboBoxColumn)workflowDefinitionList.Columns["empListCol"]).ItemsSource = listOfEmployeeTypes;The grid is populated OK and every column has the right value filled in.
Now the real issue: When I click on the column header for the employee type column, i get this exception. If I omit the SortMemberPath, than sorting will not throw an exception. Off course everything is sorted then on the EmployeeTypeOptionDetailId, which is not what I want.
Does anyone have any idea? I'm puzzled at the moment that something this trivial is giving me such a headache.
Thanks,
Sodi We