This question is locked. New answers and comments are not allowed.
I have the ItemsSource of a RadListPicker bound to a Key/Value list. I've bound the key/value list to the ItemsSource of the RadListPicker. I'm trying to two-way bind the SelectedItem to a property on the ViewModel.
On the WinForms RadComboBox, there are both DisplayMember and ValueMember, which makes data binding easy (set DisplayMember = "value", ValueMember = "key", and bind to SelectedValue). On RadListPicker, there is DisplayMemberPath but no ValueMemberPath. When I try to bind to SelectedItem, I get an ArgumentException "SelectedItem is not contained within the ItemsSource." exception, because it's trying to bind to the key/value pair object, not the key value of the pair.
I'm trying to think if there's a way to write a two-way converter to do what I want, but I think I'd need access to the ItemsSource of the list picker in order to iterate over its items and pick the appropriate one.
On the WinForms RadComboBox, there are both DisplayMember and ValueMember, which makes data binding easy (set DisplayMember = "value", ValueMember = "key", and bind to SelectedValue). On RadListPicker, there is DisplayMemberPath but no ValueMemberPath. When I try to bind to SelectedItem, I get an ArgumentException "SelectedItem is not contained within the ItemsSource." exception, because it's trying to bind to the key/value pair object, not the key value of the pair.
I'm trying to think if there's a way to write a two-way converter to do what I want, but I think I'd need access to the ItemsSource of the list picker in order to iterate over its items and pick the appropriate one.