Reset RadExpander IsExpandedState when in RadDataBoundListBox

2 posts, 0 answers
  1. Marco
    Marco avatar
    1 posts
    Member since:
    Aug 2012

    Posted 31 Jul 2013 Link to this post

    Hi,

    I am using a RadExpander in the ItemTemplate of a RadDataBoundListBox. My application needs to change the contents of the whole list (by replacing the ItemsSource property): when this happens the expanders will retain the expanded state that they had in the previous list.

    Is it possible to avoid this behavior and have the expanders all start at their initial state when the list items are replaced?

    Thank you for your time,

    Marco
  2. Deyan
    Admin
    Deyan avatar
    2039 posts

    Posted 05 Aug 2013 Link to this post

    Hello Marco,

    Thanks for writing and for your question.

    Yes, you can achieve this behavior by introduce a Boolean property on your Business Entity which you should bind (twoway mode) to the IsExpanded property of the Expander in your Data Template. This will allow you to always store the state in your ViewModel and have the expanders correctly displayed.

    I hope this helps.

    Regards,
    Deyan
    Telerik
    Have a suggestion or face a problem - you can use the Ideas & Feedback portal to submit ideas, feedback and vote for them.
  3. DevCraft banner
Back to Top