More in this section

RadMenu

4 posts, 0 answered
  1. Sasa
    Sasa avatar
    17 posts
    Registered:
    24 Aug 2007
    31 Aug 2007
    Link to this post
    How can I customize the way RadMenu renders it's content?

    For example, I need to create vertical (tree-like) menu list which displays immediate child and parent nodes of the current  node expanded. Like:

    Node 1
    ----------
    Node 2
    ----------
    Current Parent Node
        -Child1
        -Current child node
            -Current child's child node
        ---------------------
        -Child3
    ------------
    Node 4


    Is this doable with RadMenu or one should build a custom control?
  2. Sonya
    Sonya avatar
    231 posts
    Registered:
    24 Sep 2012
    31 Aug 2007
    Link to this post
    Hi Sasa,

    RadMenu provides wide functionality, and a vertical menu is part of it. Here is some code with which you could achieve similar behavior.

    <script language="javascript" type="text/javascript">     
          function ExpandItemByText()     
    {      
    var menu = <%= RadMenu1.ClientID %>;      
    var item = menu.FindItemByText('This');      
    if (!item)      
    {     
     alert("Item with text not found.");     
     return;      
    }     
    // override the initial focus executed by the browser on load      
    setTimeout(function () { item.Focus(); }, 0);      
    }      
    </script>    
        
    <radM:RadMenu ID="RadMenu1" runat="server" OnClientLoad="ExpandItemByText">     
        <Items>    
            <radM:RadMenuItem runat="server" Text="Root 1" ID="Radmenuitem1">     
            </radM:RadMenuItem>    
            <radM:RadMenuItem runat="server" Text="Root 2" ID="Radmenuitem2">     
                <Items>    
                    <radM:RadMenuItem runat="server" Text="Child 1" ID="Radmenuitem3">     
                    </radM:RadMenuItem>    
                    <radM:RadMenuItem runat="server" Text="This" ID="Radmenuitem4">     
                    </radM:RadMenuItem>    
                </Items>    
            </radM:RadMenuItem>    
            <radM:RadMenuItem runat="server" Text="Root 3" ID="Radmenuitem5">     
                <Items>    
                    <radM:RadMenuItem runat="server" Text="Child 1" ID="Radmenuitem6">     
                    </radM:RadMenuItem>    
                    <radM:RadMenuItem runat="server" Text="Child 2" ID="Radmenuitem7">     
                    </radM:RadMenuItem>    
                </Items>    
            </radM:RadMenuItem>    
        </Items>    
    </radM:RadMenu>    
     

    Here is an implemented vertical menu along with the code:
    http://www.telerik.com/demos/aspnet/Menu/Examples/Programming/OpenOnPostback/DefaultCS.aspx

    For more information, please have a look at the following posts:
    http://www.telerik.com/community/forums/thread/b311D-ghgat.aspx
    http://www.telerik.com/community/forums/thread/b311D-echch.aspx

    Hope this helps. 

    Best wishes,
    Sonya
    the Telerik team

    Instantly find answers to your questions at the new Telerik Support Center
  3. Sasa
    Sasa avatar
    17 posts
    Registered:
    24 Aug 2007
    31 Aug 2007
    Link to this post
    Actually, I've had in mind the type of  menu like the one on the left side of the page you've mentioned ("Demos" menu): http://www.telerik.com/demos/aspnet/Menu/Examples/Programming/OpenOnPostback/DefaultCS.aspx.

    Is this also a RadMenu control or something else?

    Does telerik have a community  irc channel where one could ask this kind of questions directly?
  4. Sonya
    Sonya avatar
    231 posts
    Registered:
    24 Sep 2012
    31 Aug 2007
    Link to this post
    Hello Sasa,

    Please excuse me for the misunderstanding - now I realize what you had asked. The control you desire is not RadMenu but RadPanelBar.
    Here is a link to an example: http://www.telerik.com/demos/aspnet/panelbar/examples/appearance/skins/defaultcs.aspx

    If you click on File-> New, you could observe the same functionality as the one on the link from the previous post.
    Again, at the lower part of the RadPanelBar page you could find the code.

    As to your second question - unfortunately, there is no irc channel for the Telerik community yet.

    Hope this helps. 

    Kind regards,
    Sonya
    the Telerik team

    Instantly find answers to your questions at the new Telerik Support Center
Register for webinar
4 posts, 0 answered