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

RadMenu Add Child Menu Item to Parent Menu Item

1 Answer 40 Views
This is a migrated thread and some comments may be shown as answers.
Top achievements
Rank 1
Joe asked on 13 Aug 2015, 01:26 AM


 I have been using the Client Side API and also looking all over the internets for a solution to this problem and have not seen a thing.

 I have a RadMenu that is created dynamically server side. This menu can have as many menu items as the user defines. I would like to add a child menu item to a parent menu item via Telerik's Client Side API. 

The Add and Insert functions both seem to add the item to the menu as a parent instead of adding the child item inside of the parent menu item. Is there a way I can add the child item to the parent item, so that it displays within the parent items drop down? Ultimately, I would like to create a multilevel drop down.

 Here is some test code I have written, to see if this is possible.Thanks!


    function AddMenuItems() {
            var menu = $find("<%= testMenu.ClientID %>")

            var parentItem = new Telerik.Web.UI.RadMenuItem();


            var childItem = new Telerik.Web.UI.RadMenuItem();
            menu.get_items().insert((menu.get_allItems().length), childItem); <== Adds the item after the parent item instead of inside. 

    <AxnMenus:AxnMenu ID="testMenu" runat="server" OnClientLoad="AddMenuItems">
        <AxnMenus:AxnMenuItem Text="item 1" runat="server"/>
        <AxnMenus:AxnMenuItem Text="item 2" runat="server"/>
        <AxnMenus:AxnMenuItem Text="item 3" runat="server"/>
        <AxnMenus:AxnMenuItem Text="item 4" runat="server"/>
        <AxnMenus:AxnMenuItem Text="item 5" runat="server"/>
        <AxnMenus:AxnMenuItem Text="item 6" runat="server"/>
        <AxnMenus:AxnMenuItem Text="item 7" runat="server"/>
        <AxnMenus:AxnMenuItem Text="item 8" runat="server"/>
        <AxnMenus:AxnMenuItem Text="item 9" runat="server"/>
        <AxnMenus:AxnMenuItem Text="item 10" runat="server"/>
        <AxnMenus:AxnMenuItem Text="item 11" runat="server"/>
        <AxnMenus:AxnMenuItem Text="item 12" runat="server"/>
        <AxnMenus:AxnMenuItem Text="item 13" runat="server"/>


1 Answer, 1 is accepted

Sort by
Ivan Danchev
Telerik team
answered on 13 Aug 2015, 04:29 PM

I answered your question in this thread. If you have more questions I suggest we continue the discussion in it in order to avoid thread duplication.

Ivan Danchev
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 Feedback Portal and vote to affect the priority of the items
Asked by
Top achievements
Rank 1
Answers by
Ivan Danchev
Telerik team
Share this question