How to Set a Selected Panelbar Item on Redirect

Thread is closed for posting
2 posts, 0 answers
  1. 63F75A2C-1F16-4AED-AFE8-B1BBD57646AD
    63F75A2C-1F16-4AED-AFE8-B1BBD57646AD avatar
    1572 posts
    Member since:
    Oct 2004

    Posted 26 May 2006 Link to this post

     

    Requirements

    r.a.d.panelbar version

    classic RadPanelBar (3.7; 4.x)
    RadPanelBar for ASP.NET AJAX (Prometheus)
    Telerik.Web.UI 2008.1.x

    .NET version

    2.0

    Visual Studio version

    2005

    programming language

    VB, C#

    browser support

    all browsers supported by r.a.d.panelbar



    DESCRIPTION
    This project shows hot to set a panelbar item to be selected on redirect.



    SOLUTION
    We are using the PersistStateInCookie property to persist the state between pages (expanded and selected items).





    RadPanelBar [v.4.x]

    SOLUTION

    We are using the PersistStateInCookie property to persist the state between pages (expanded and selected items).



    RadPanelBar [v.3.x]

    SOLUTION
    The items from the first root group (Bekleidung) use the FindPanelItemById to find the item and make it Selected. Whereas, the items from the second root group (Pistolen) use a query string passed along with the NavigateUrl value from the data table to specify the SelectedPanelItem.

    Either way works. Just note that if you are using the second method, the NavigateUrl value must be of the form: "Pistolen1.aspx?sid=Pistolen2_1"
     
  2. 9818C265-0F64-4FFA-9FE4-F794771D729C
    9818C265-0F64-4FFA-9FE4-F794771D729C avatar
    2 posts
    Member since:
    May 2005

    Posted 26 Mar 2007 Link to this post

    Hi,

    I use this code [RadPanelBar v.3.x only] to select the item in other level diferentent that the first level.

    1 PanelItem selected = RPBCatalogoDer.FindPanelItemById(MenuID);  
    2             if (selected != null)  
    3             {  
    4                 selected.Expanded = true;  
    5                 RPBCatalogoDer.SelectedPanelItem = selected;  
    6                 while (selected.ParentItem != null && selected.ParentItem.ID != "RPBCatalogoDer")  
    7                 {  
    8                     selected = (PanelItem)selected.ParentItem;  
    9                     selected.Expanded = true;  
    10                 }  
    11             } 

    RPBCatalogoDer -> Is the name of the PanelBar
    MenuID -> Is the Numeric ID of the item

    Thanks,
    William V
Back to Top

This Code Library is part of the product documentation and subject to the respective product license agreement.