+1-888-365-2779
Try Now
More in this section

Forums / Developing with Sitefinity / RadPanelBar Expand/Collapse behavior

RadPanelBar Expand/Collapse behavior

4 posts, 0 answered
  1. Alexander Resnik
    Alexander Resnik avatar
    2 posts
    Registered:
    28 Dec 2005
    09 Jul 2009
    Link to this post
    Hello

    I have add RadPanelBar as left site menu. But it exapands all menu sub-items on page load. Is it default behavior? I wish to have only one menu expaned at the time. I have configured corresponding property but had no gotten correct behavior. Please can you take a look at dev site here:

    http://dev29.testworx.co.uk/

    What I do wrong?

    Another problem is cursor shape.  While moving over menu items, each last sub-menu item has wrong cursor. And all last menu with all its sub-menus too.

    How can I amend css or something to have it working?

    Thanks

    Alex
  2. Nikolai
    Nikolai avatar
    216 posts
    Registered:
    21 Nov 2016
    10 Jul 2009
    Link to this post
    Hello Alexander Resnik,

    Probably there is an issue with the CSS styling of the RadPanelBar, so I will ask you if you can open a support ticket and send us you version of the control.

    Here is a simple example on how the behavior you want can be implemented:
    <telerik:RadPanelBar ID="RadPanelBar1" runat="server" Skin="Outlook" OnItemClick="ItemClick"
     <Items> 
       <telerik:RadPanelItem runat="server" Text="Mail"
         <Items> 
           <telerik:RadPanelItem runat="server" Text="In Box" /> 
           <telerik:RadPanelItem runat="server" Text="Deleted Items" /> 
           <telerik:RadPanelItem runat="server" Text="Sent Items" /> 
         </Items> 
      </telerik:RadPanelItem> 
      <telerik:RadPanelItem runat="server" Text="Calendar"
         <Items> 
           <telerik:RadPanelItem runat="server"
             <ItemTemplate> 
               <telerik:RadCalendar ID="RadCalendar1" runat="server" Skin="Outlook" /> 
             </ItemTemplate> 
           </telerik:RadPanelItem> 
         </Items> 
      </telerik:RadPanelItem> 
      <telerik:RadPanelItem runat="server" Text="Notes"
         <Items> 
            <telerik:RadPanelItem runat="server" Text="My Notes" /> 
            <telerik:RadPanelItem runat="server" Text="Shared Notes" /> 
            <telerik:RadPanelItem runat="server" IsSeparator="True" Text="<hr>" /> 
            <telerik:RadPanelItem runat="server" Text="Archive"
               <Items> 
                  <telerik:RadPanelItem runat="server" Text="My Notes" /> 
                  <telerik:RadPanelItem runat="server" Text="Shared Notes" /> 
               </Items> 
            </telerik:RadPanelItem> 
          </Items> 
       </telerik:RadPanelItem> 
     </Items> 
    </telerik:RadPanelBar>  

    and the code-behind:

    protected void Page_Load(object sender, EventArgs e) 
        { 
            this.RadPanelBar1.Items[0].Expanded = true
        } 
     
        protected void ItemClick(object sender, RadPanelBarEventArgs e) 
        { 
            foreach(RadPanelItem rpi in this.RadPanelBar1.Items) 
            { 
                if(rpi!=e.Item) 
                { 
                    rpi.Expanded = false
                } 
                else 
                { 
                    rpi.Expanded = true
                } 
            } 
        } 

    In this example I used the default "Outlook" skin and everything works fine.
    Also there is no problem with the mouse cursor like the one on your demo page.

    Hope this helps.


    All the best,
    Nikolai
    the Telerik team

    Instantly find answers to your questions on the new Telerik Support Portal.
    Check out the tips for optimizing your support resource searches.
  3. Nikesh Bhagat
    Nikesh Bhagat avatar
    1 posts
    Registered:
    26 Jul 2009
    03 Mar 2010
    Link to this post
    Hello..

    How would you go about using a javascript function to toggle the radpanel items to open and close onclientitemclicked?

    Really, the opening of a radpanelbar is simple enough, but it doesn't seem to close by itself when it is clicked again..

    Any ideas?

    Nikesh.
  4. Ivan Dimitrov
    Ivan Dimitrov avatar
    16072 posts
    Registered:
    25 Nov 2016
    04 Mar 2010
    Link to this post
    Hello Nikesh Bhagat,

    You can use RadPanelBar client-side API - Client-Side Basics. OnClientItemClicked - get_item returns a reference to the RadPanelItem that was clicked.

    methods

    expand    Expands the item and reveals its children if any.
    collapse    Collapses the item if it is expanded.
    get_expanded    Gets the expanded/collapsed state of a panel bar item
    set_expanded    Expands /Collapses the item.


    Sincerely yours,
    Ivan Dimitrov
    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.
Register for webinar
4 posts, 0 answered