Show asp panel on item selected

4 posts, 0 answers
  1. Chris
    Chris avatar
    120 posts
    Member since:
    Jun 2006

    Posted 04 Aug 2010 Link to this post

    I would like to have a panel bar and on item selected, I would like to show or hide a asp:panel control (ie panel1.visible = true).  Each item selected will show a separate panel, so when selecting a new item, the old panel will hide and the new panel will show.  Can someone help with this? 
  2. Shinu
    Shinu avatar
    17764 posts
    Member since:
    Mar 2007

    Posted 05 Aug 2010 Link to this post

    Hello Chris,


    You can do this from client side. Attach the 'OnClientItemClicked' client event and check for the item clicked in the handler, now access the asp:panel client object and set the visibility based on the RadPanelItem clicked.

    Here is the client code to show/hide the asp:panel:
    // Show panel
             document.getElementById(panelID).style.display = 'block';
    // Hide panel
             document.getElementById(panelID).style.display = 'none';



    -Shinu.
  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. Chris
    Chris avatar
    120 posts
    Member since:
    Jun 2006

    Posted 05 Aug 2010 Link to this post

    How would this work in this scenario:
    PanelBarItem1 shows Panel1 and hides all other Panels
    PanelBarItem2 shows Panel2 and hides all other Panels
    PanelBarItem3 shows Panel3 and hides all other Panels
    PanelBarItem4 shows Panel4 and hides all other Panels
  5. Yana
    Admin
    Yana avatar
    4554 posts

    Posted 06 Aug 2010 Link to this post

    Hello Chris,

    I suggest you use RadMultiPage in this case, you just need to set its SelectedIndex property when the panelbar item is clicked - this can be done on the client. Please try it and if you have any problems, contact us again.

    All the best,
    Yana
    the Telerik team
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
Back to Top