This is a migrated thread and some comments may be shown as answers.

Collapse All Others when expanding one

1 Answer 32 Views
ExpanderControl
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
Justin
Top achievements
Rank 1
Justin asked on 28 Jun 2013, 01:46 AM
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?

Thanks!
Justin

1 Answer, 1 is accepted

Sort by
0
Accepted
Deyan
Telerik team
answered on 28 Jun 2013, 07:18 AM
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.

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.
Tags
ExpanderControl
Asked by
Justin
Top achievements
Rank 1
Answers by
Deyan
Telerik team
Share this question
or