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

Expanding RadPanelBarItem Programmatically

1 Answer 129 Views
PanelBar
This is a migrated thread and some comments may be shown as answers.
Sam
Top achievements
Rank 1
Sam asked on 30 Nov 2009, 09:56 AM
I have a RadPanelBar that I create programmtically on initial load.  I am able to tell it which RadPanelBarItem is expanded or not at this time, and this works as expected.

I have a requirement where I have a button and when I click on it, it will expand the last RadPanelBarItem and collapse the other RadPanelBarItems, if it is open.  I can't get seem to get it to expand or collapse once it is opened.

Any help would be appreciated.

I am setting the IsExpanded Property of RadPanelBarItem and it does not chance after setting. I've tried the following:

foreach (RadPanelBarItem panelBarItem in PanelBar.Items) {
panelBarItem.IsExpanded = false;
}
((RadPanelBarItem )PanelBar.Items.Last()).IsExpanded = 
true;

foreach
 (RadPanelBarItem panelBarItem in PanelBar.Items) {
panelBarItem.SetValue(RadPanelBarItem.IsExpandedProperty, true)
}
((RadPanelBarItem )PanelBar.Items.Last()).SetValue(RadPanelBarItem.IsExpandedProperty, true);

1 Answer, 1 is accepted

Sort by
0
Accepted
Tihomir Petkov
Telerik team
answered on 30 Nov 2009, 05:28 PM
Hi Sam,

I prepared a sample project which demonstrates how to collapse all items and expand the last one when a button is clicked. Please take a look at it and let me know if it helps.

Best wishes,
Tihomir Petkov
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
Tags
PanelBar
Asked by
Sam
Top achievements
Rank 1
Answers by
Tihomir Petkov
Telerik team
Share this question
or