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

Reset RadExpander IsExpandedState when in RadDataBoundListBox

1 Answer 43 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.
Marco
Top achievements
Rank 1
Marco asked on 31 Jul 2013, 08:28 PM
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

1 Answer, 1 is accepted

Sort by
0
Deyan
Telerik team
answered on 05 Aug 2013, 06:36 AM
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.
Tags
ExpanderControl
Asked by
Marco
Top achievements
Rank 1
Answers by
Deyan
Telerik team
Share this question
or