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

PanelBar Collapse

3 Answers 103 Views
PanelBar
This is a migrated thread and some comments may be shown as answers.
Shmulik
Top achievements
Rank 1
Shmulik asked on 28 Jul 2008, 07:57 PM
When navigating to a page that is not one of the panel items the panel collapses, is there a way to make it return to load status?

3 Answers, 1 is accepted

Sort by
0
Rosi
Telerik team
answered on 29 Jul 2008, 08:04 AM
Hello Shmulik,

You can set the PersistStateInCookie property to true.

Please see also our online examples:
Persist State in Cookie
Programmatic State Persistence

Regards,
Rosi
the Telerik team

Check out Telerik Trainer, the state of the art learning tool for Telerik products.
0
Shmulik
Top achievements
Rank 1
answered on 29 Jul 2008, 04:38 PM
Hi Rosi,
Thanks for your reply, it was very helpful.
is there a way we can make the panel expand to all the parent (only top level).
same as it starts when you first load the page?
Thanks
0
Rosi
Telerik team
answered on 30 Jul 2008, 07:14 AM
Hello Shmulik,

Yes, you can do this by javascript collapsing all items and expanding these from first level:
 
<script> 
function pageLoad()  
{  
 
    var panel = $find("RadPanelBar1");  
    var items =panel.get_expandedItems();  
    for(var i = 0;i<items.length;i++)  
    {  
           items[i].collapse();  
    }  
    for(var i = 0;i<panel.get_items().get_count();i++)  
    {  
           items[i].expand();  
    }  
 
}  
</script> 

or you can do this on server side by hooking on the PreRender event of RadPanelBar:

protected void RadPanelBar1_PreRender(object sender, EventArgs e)  
{  
            RadPanelBar1.CollapseAllItems();  
            for (int i = 0; i < RadPanelBar1.Items.Count; i++)  
            {  
                RadPanelBar1.Items[i].Expanded = true;  
            }  


Regards,
Rosi
the Telerik team

Check out Telerik Trainer, the state of the art learning tool for Telerik products.
Tags
PanelBar
Asked by
Shmulik
Top achievements
Rank 1
Answers by
Rosi
Telerik team
Shmulik
Top achievements
Rank 1
Share this question
or