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

RadPanelBar Expand by Default

4 Answers 175 Views
PanelBar
This is a migrated thread and some comments may be shown as answers.
Scott
Top achievements
Rank 1
Scott asked on 21 Dec 2010, 08:27 PM
I am using RadPanelBar to populate the quick launch in SharePoint 2010. It works beautifully but I was curious if you could expand every node by default. Thanks.

4 Answers, 1 is accepted

Sort by
0
Tina Stancheva
Telerik team
answered on 22 Dec 2010, 04:45 PM
Hello Scott,

If the RadPanelBar is databound, then the best approach is to use ContainerBindings (you can follow the approach described here) to bind the RadPanelBarItem IsExpanded property to a related property from your ViewModel. This will allow you to control which items to be expanded at any given moment. Still, please keep in mind that in order to expand more than one RadPanelBarItem at a time, you will need to set the ExpandMode property to Multiple.

Another approach you can use is to call the RadPanelBar ExpandAll() method when the RadPanelBar is loaded:
private void radPanelBar_Loaded(object sender, RoutedEventArgs e)
{
    (sender as RadPanelBar).ExpandAll();
}

I hope this info will help you. Please let us know if we can further assist you.

Greetings,
Tina Stancheva
the Telerik team
Browse the videos here>> to help you get started with RadControls for Silverlight
0
Scott
Top achievements
Rank 1
answered on 22 Dec 2010, 04:51 PM
Thanks for the reply Tina. After taking a second look I am in the wrong forum.

I am trying to implement the ASP.NET Ajax version as shown below. Therefor I am implementing the PanelBar into the Sharepoint Master Page. Could you move my topic or pass it along? Thanks!

http://www.telerik.com/help/aspnet-ajax/replace-sharepoint-quick-launch-menu-with-radpanelbar.html
0
Kalina
Telerik team
answered on 28 Dec 2010, 04:16 PM
Hello Scott,

Let me suggest you handle the OnClientLoad event of the RadPanelBar and expand the RadPanelItems in this way:
function OnClientLoadHandler(sender, eventArgs)
{
  for (var i=0; i < sender.get_items().get_count(); i++)
  {
      sender.get_items().getItem(i).set_expanded(true);
  }
}

Please let me know if this was helpful.

Regards,
Kalina
the Telerik team
Browse the vast support resources we have to jump start your development with RadControls for ASP.NET AJAX. See how to integrate our AJAX controls seamlessly in SharePoint 2007/2010 visiting our common SharePoint portal.
0
Scott
Top achievements
Rank 1
answered on 07 Jan 2011, 02:58 PM
Thank you for the help Kalina!
Tags
PanelBar
Asked by
Scott
Top achievements
Rank 1
Answers by
Tina Stancheva
Telerik team
Scott
Top achievements
Rank 1
Kalina
Telerik team
Share this question
or