This is a migrated thread and some comments may be shown as answers.

SelectedValuePath did not work properly

1 Answer 124 Views
ListPicker
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
Lion Pham
Top achievements
Rank 1
Lion Pham asked on 28 Jun 2013, 08:56 PM
Hi,

I'm using RadListPicker but I have a problem when using it. 

I have a Dictionary<String, String> named Source:

Dictionary<String, String> Source


When I set SelectedValuePath propery of RadListPicker to "Key", a run-time error occured: {System.ArgumentException: Value does not fall within the expected range.}

<telerikInput:RadListPicker
ItemsSource="{Binding Source}"
DisplayMemberPath="Value"
SelectedValuePath="Key" />

Can you help me to solve this problem?

Thanks in advanced.

1 Answer, 1 is accepted

Sort by
0
Accepted
Deyan
Telerik team
answered on 02 Jul 2013, 07:04 AM
Hello Dung,

This behavior is expected since the enumerator of the Dictionary class enumerates the values. In that case, you should simply bind the control without using SelectedValuePath or think of a way to encapsulate the Key-Value pairs in your own data objects.

Hope this helps.

Regards,
Deyan
Telerik
TRY TELERIK'S NEWEST PRODUCT - EQATEC APPLICATION ANALYTICS for WINDOWS PHONE 7.
Learn what features your users use (or don't use) in your application. Know your audience. Target it better. Develop wisely.
Sign up for Free application insights >>
Tags
ListPicker
Asked by
Lion Pham
Top achievements
Rank 1
Answers by
Deyan
Telerik team
Share this question
or