Reset RadExpander IsExpandedState when in RadDataBoundListBox

Thread is closed for posting
2 posts, 0 answers
  1. Marco
    Marco avatar
    1 posts
    Member since:
    Aug 2012

    Posted 31 Jul 2013 Link to this post


    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,

  2. Deyan
    Deyan avatar
    2147 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.

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