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

Show asp panel on item selected

3 Answers 77 Views
PanelBar
This is a migrated thread and some comments may be shown as answers.
Chris
Top achievements
Rank 1
Chris asked on 05 Aug 2010, 01:51 AM
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? 

3 Answers, 1 is accepted

Sort by
0
Shinu
Top achievements
Rank 2
answered on 05 Aug 2010, 06:39 AM
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.
0
Chris
Top achievements
Rank 1
answered on 05 Aug 2010, 03:38 PM
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
0
Yana
Telerik team
answered on 06 Aug 2010, 10:21 AM
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
Tags
PanelBar
Asked by
Chris
Top achievements
Rank 1
Answers by
Shinu
Top achievements
Rank 2
Chris
Top achievements
Rank 1
Yana
Telerik team
Share this question
or