Keeping RadDropDownButton content on close

2 posts, 0 answers
  1. Mrn
    Mrn avatar
    29 posts
    Member since:
    Apr 2011

    Posted 11 Aug 2011 Link to this post


    Hi,

    I have set a ListBox as a content for a RadDropDownButton, and I find that, after a user has selected an item from the list and clicks the button to close it, if she clicks again to re-open the list, her previous selection has been lost... I'd like to keep the same ListBox even if the user closes the button content, is there any way to achieve that?

    Thanks!
  2. Tina Stancheva
    Admin
    Tina Stancheva avatar
    3298 posts

    Posted 16 Aug 2011 Link to this post

    Hello Mrn,

    I am not sure if I understand your scenario correctly - do you display a ListBox as DropDownContent of the RadDropDownButton? If this is the case, if the ListBox.Items collection is populated in XAML then the selection should be kept even if the DropDownContent is closed and later opened.

    If the ListBox is databound to a business collection of items, then in order to keep the selection, you will need to bind the ListBoxItem IsSelected property to a property from your view models.

    I hope thins info will help you. However, if I am missing something or you need more info, please let me know.

    Regards,
    Tina Stancheva
    the Telerik team

    Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get now >>

  3. DevCraft banner
Back to Top