SelectedValuePath did not work properly

2 posts, 1 answers
  1. Lion Pham
    Lion Pham avatar
    13 posts
    Member since:
    May 2013

    Posted 28 Jun 2013 Link to this post

    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.
  2. Answer
    Deyan
    Admin
    Deyan avatar
    2039 posts

    Posted 02 Jul 2013 Link to this post

    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 >>
  3. DevCraft banner
Back to Top