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

RadPanelBar Loses State When Moving From Page To Page

3 Answers 88 Views
PanelBar
This is a migrated thread and some comments may be shown as answers.
Larry
Top achievements
Rank 1
Larry asked on 21 Apr 2009, 07:23 PM
Hey,

I'm working with a RadPanelBar in a master page.   The menu is three levels deep and I'm using a datasource to populate the menu options.  The problem I'm having is when I go from menu option to menu option the menus collapse each time. I'd like to keep the menu expanded as the user goes from page to page.  I've tried "PersistStateInCookie" but sometimes it works and sometimes it does not.  Any Suggestions would be appreciated.

Thanks,
Larry

3 Answers, 1 is accepted

Sort by
0
Sergio Cortez
Top achievements
Rank 2
answered on 21 Apr 2009, 09:45 PM
Hi Larry
To provide this behavior i use the following code in my Page_Load event

 RadPanelItem radItem = myradPanelBar.FindItemByUrl(Request.Url.ToString());
            if (radItem != null)
            {
                radItem.Selected = true;
                radItem.Expanded = true;
            }

This code will get the Item related to a given URL and select and expand this RadPanelItem.

Hope it helps
0
Accepted
Paul
Telerik team
answered on 23 Apr 2009, 01:41 PM
Hi Larry,

Please take a look at our Programmatic State Persistence example for details on the matter.

Sincerely yours,
Paul
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Check out the tips for optimizing your support resource searches.
0
Larry
Top achievements
Rank 1
answered on 29 Apr 2009, 05:02 PM
Thanks all who responded.

Paul,
The demo was helpful.
Tags
PanelBar
Asked by
Larry
Top achievements
Rank 1
Answers by
Sergio Cortez
Top achievements
Rank 2
Paul
Telerik team
Larry
Top achievements
Rank 1
Share this question
or