RadPanelBar Expand by Default

5 posts, 0 answers
  1. Scott
    Scott avatar
    7 posts
    Member since:
    Nov 2010

    Posted 21 Dec 2010 Link to this post

    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.

  2. Tina Stancheva
    Admin
    Tina Stancheva avatar
    3298 posts

    Posted 22 Dec 2010 Link to this post

    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
  3. DevCraft banner
  4. Scott
    Scott avatar
    7 posts
    Member since:
    Nov 2010

    Posted 22 Dec 2010 Link to this post

    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
  5. Kalina
    Admin
    Kalina avatar
    918 posts

    Posted 28 Dec 2010 Link to this post

    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.
  6. Scott
    Scott avatar
    7 posts
    Member since:
    Nov 2010

    Posted 07 Jan 2011 Link to this post

    Thank you for the help Kalina!
Back to Top
DevCraft banner