Listpicker window mode displays both key and value of bound items source

4 posts, 0 answers
  1. IDispose
    IDispose avatar
    12 posts
    Member since:
    Apr 2010

    Posted 18 Dec 2010 Link to this post

    Hi
    I am trying to use RadListPicker and bind it to a Dictionary<int, string>

    The Picker control itself display the selected value correctly. I have set the DisplayMemberPath = "Value"

    My Dictionary had the following items

    1 Sunday
    2 Monday
    3 Tuesday
    etc
    When I click inside the list picker, the windows with values to pick is displayed but it displays

    [1, Sunday]
    [2, Monday]
    etc

    How do I get it to display only
    Sunday
    Monday etc?

    Thanks
  2. Valentin.Stoychev
    Admin
    Valentin.Stoychev avatar
    2198 posts

    Posted 20 Dec 2010 Link to this post

    Hello Ramesh Sringeri,

    Thank you for reporting this. It is a bug in the control implementation.

    The internally used listbox which is displayed in the window is not respecting the DisplayMemberPath property. To fix this you can edit the control template and to declare a template binding for the DisplayMemberPath property like that:

    <telerikPrimitives:RadSelector x:Name="PopupList"
                                                                  Background="{StaticResource PhoneChromeBrush}"
                                                                  HorizontalAlignment="Stretch" 
                                                                  VerticalAlignment="Stretch"
                                                                  FontSize="{TemplateBinding FontSize}"
                                                                  Header="{TemplateBinding PopupHeader}"
                                                                  DisplayMemberPath="{TemplateBinding DisplayMemberPath}"
                                                                  HeaderTemplate="{TemplateBinding PopupHeaderTemplate}"
                                                                  HeaderStyle="{TemplateBinding PopupHeaderStyle}"/>

    The other option would be to set the source of the list picker declaratively.

    We alredy fixed this internally - if you need the fix before the next release - please let us know and we will provide you with an internal build.

    Thank you once again for the feedback! Please let us know if you have any other comments on the controls.

    I updated your telerik points.

    Greetings,
    Valentin.Stoychev
    the Telerik team

    Check out Telerik Trainer, the state of the art learning tool for Telerik products.
  3. DevCraft banner
  4. IDispose
    IDispose avatar
    12 posts
    Member since:
    Apr 2010

    Posted 20 Dec 2010 Link to this post

    Thanks for the response. I would love to get the latest internal bits as long as I can publish my Windows phone 7 app to that marketplace using these bits.

  5. Deyan
    Admin
    Deyan avatar
    2037 posts

    Posted 23 Dec 2010 Link to this post

    Hello Ramesh,

    Thanks for writing back.

    We will be able to provide you with an internal build of our controls in the beginning of January 2011. By that time you could use the workaround my colleague Valentin shared with you.

    Do not hesitate to get back to us in case you have further questions or need assistance.

    Regards,
    Deyan
    the Telerik team

    Check out Telerik Trainer, the state of the art learning tool for Telerik products.
Back to Top