Collapse All Others when expanding one

Thread is closed for posting
2 posts, 1 answers
  1. Justin
    Justin avatar
    7 posts
    Member since:
    Feb 2013

    Posted 27 Jun 2013 Link to this post

    Hi, I have an expanded control in the item template of my RadDataBoundListBox.

    I would like to bind the IsExpanded property to IsSelected so only the selected item is expanded. Is there a way to do this? is it built into the control?

  2. Answer
    Deyan avatar
    2147 posts

    Posted 28 Jun 2013 Link to this post

    Hello Justin,

    You can introduce a IsExpanded property on your business object and bind the IsExpanded property of the expander to it. Make sure to fire the PropertyChanged event in the setter of this property. You can then subscribe for the SelectionChanged event of the DataBoundListBox and set the IsExpanded property of the selected item to true and the unselected one to false. The SelectionChanged event provides you with access to the selected item and the one that has been selected before that.

    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