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

Full Expand & Readonly

4 Answers 80 Views
PanelBar
This is a migrated thread and some comments may be shown as answers.
bill
Top achievements
Rank 1
bill asked on 09 Apr 2010, 10:30 PM
I would like my panel to always have every item expanded.  I would also like to prevent users from clicking on the panel.  I am binding the panel to a site map, and I want the user to be able to see where they're at in the wizard, but I don't want them to navigate via the panel.  Are there properties I can set to allow this?

4 Answers, 1 is accepted

Sort by
0
Princy
Top achievements
Rank 2
answered on 12 Apr 2010, 11:18 AM
Hello Bill,

You can try the following code snippet in order to expand all the items.
CS:
 
    protected void RadPanelBar1_PreRender(object sender, EventArgs e) 
    { 
        foreach(RadPanelItem item in RadPanelBar1.GetAllItems() ) 
        { 
            if (item.Items.Count>0) 
            { 
                item.Expanded = true
            } 
        } 
    } 

Attach the 'OnClientItemClicking' event to RadPanelBar and use the args.set_cancel(true) in order to cancel the event.
JavaScript:
 
<script type="text/javascript"
    function OnClientItemClicking(sender, args) { 
        args.set_cancel(true); 
    } 
</script> 

Thanks,
Princy.
0
bill
Top achievements
Rank 1
answered on 12 Apr 2010, 04:28 PM
Thank you for your resopnse.  How would I attach the RadPanelBar to the javascript function?
0
Princy
Top achievements
Rank 2
answered on 13 Apr 2010, 08:39 AM
Hello Bill,

You could simply assign the name of the javascript function as the value of the the corresponding RadPanelBar property.

ASPX:
 
<telerik:RadPanelBar ID="RadPanelBar1" runat="server" OnClientItemClicking="OnClientItemClicking" > 
 ... 
</telerik:RadPanelBar> 

Regards,
Princy.
0
bill
Top achievements
Rank 1
answered on 13 Apr 2010, 03:37 PM

Tags
PanelBar
Asked by
bill
Top achievements
Rank 1
Answers by
Princy
Top achievements
Rank 2
bill
Top achievements
Rank 1
Share this question
or