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

howto: Changing selected RadpanelItem dynamically with javascript and causing radpanel to display it

2 Answers 125 Views
PanelBar
This is a migrated thread and some comments may be shown as answers.
Christos
Top achievements
Rank 1
Christos asked on 05 Dec 2008, 04:12 PM
Hello,
In my page I have a button.
When I press this button, I want radpanelbar to expand/collapse and  make a specific item as selected, without leaving/reloading  the page.
I can find the item I want to be selected.
I'm looking for the functions to make radpanelbar expand/collapse in order to show this item as selected.
For example:
In page
http://www.telerik.com/help/aspnet-ajax/editoroverview.html
<overview> is highlighted.
with my javascript, the selection <RadAjax for ASP.NET vs RadAjax for ASP.NET AJAX> will be highlighted (thus the tree will expand by itsself) , but the page that it'll show will be still the same page (http://www.telerik.com/help/aspnet-ajax/editoroverview.html).

he code is :
<script type="text/javascript">
<!--
function MsgBox1() {
alert("beginning");
var panel1 = $find('ctl00_PlaceHolderLeftNavBar_RadPanelBar3'); // I had problem using $find (<%= RadPanelBar3 %>)
var item1 = panel1.get_items();
var itemurl = panel1.findItemByText("RadAjax for ASP.NET vs RadAjax for ASP.NET AJAX");.
// which function should I call to make itemurl as the selected and make radpanelbar redisplay (thus showing itemurl as selected);
}
 -->
</script>
<INPUT NAME="submit" TYPE=Button VALUE="Change RadPanelMenou!!" onClick="MsgBox1()">

I hope it's not very difficult to understand.
Thank you!

2 Answers, 1 is accepted

Sort by
0
Accepted
Simon
Telerik team
answered on 08 Dec 2008, 09:04 AM
Hello Christos,

You could call the expand method of the Item to expand it.

Greetings,
Simon
the Telerik team

Check out Telerik Trainer, the state of the art learning tool for Telerik products.
0
Christos
Top achievements
Rank 1
answered on 08 Dec 2008, 01:14 PM
perfect!
Tags
PanelBar
Asked by
Christos
Top achievements
Rank 1
Answers by
Simon
Telerik team
Christos
Top achievements
Rank 1
Share this question
or