SubMenu/ Multi-level menu issue in rad tree context menu

6 posts, 0 answers
  1. ankool
    ankool avatar
    50 posts
    Member since:
    Apr 2007

    Posted 01 May 2008 Link to this post

    When i use this xml in contextmenu xml file i get menu successfully attached to NODE1 of rad tree view.

    <
    ContextMenus>
        <
    Menu Name="NODE1" Width="150">
            <
    Item Text="Expand All" />
            <
    Item Text="Redraw Tree" />
        </Menu >
    </ContextMenus>

    But if i want sub menu too in my context menu, this is how i modify my xml . But then i am only getting first level menu items and not getting second level menu items.

    <ContextMenus>
        <
    Menu Name="NODE2" Width="150">
            <
    Item Text="Add" >
                <Menu >            
                        <Item Text="Page" />
                        <Item Text="Table" />
                </Menu >
            </Item >
            <
    Item Text="Redraw Tree" />
        </Menu >
    </ContextMenus>

    Is there some structure / formatting issue with my xml or rad tree view context menu doesn't support multi-levels.

  2. Nikolay
    Admin
    Nikolay avatar
    3997 posts

    Posted 01 May 2008 Link to this post

    Hello ankool,

    From the provided context menu description it seems like you are using the classic RadTreeView control and its built-in menus. Please correct me if I am wrong.

    Also, could you please paste here some code snippets on how you applied the context menu to the treeview?

    Regards,
    Nick
    the Telerik team

    Instantly find answers to your questions at the new Telerik Support Center
  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. ankool
    ankool avatar
    50 posts
    Member since:
    Apr 2007

    Posted 01 May 2008 Link to this post

    Hi Nick,

    You are right i am using rad tree view inbuilt context menu. 
    Tree is loaded dynamically and aspx code is,

    <
    radT:RadTreeView ID="RadTreeView1" runat="server" ContextMenuContentFile="RadContextMenu.xml" Skin="Office2007"></radT:RadTreeView>

    The content of xml file is ,

    <ContextMenus>
        <
    Menu Name="NODE2" Width="150">
            <
    Item Text="Add" >
                <Menu >            
                        <Item Text="Page" />
                        <Item Text="Table" />
                </Menu >
            </Item >
            <
    Item Text="Redraw Tree" />
        </Menu >
    </ContextMenus>


    However, i 'll repeat that menu runs fine when xml contains :

    <ContextMenus>
        <
    Menu Name="NODE1" Width="150">
            <
    Item Text="Expand All" />
            <
    Item Text="Redraw Tree" />
        </Menu >
    </ContextMenus>

    I am just missing second level menu items with first xml.

  5. Nikolay
    Admin
    Nikolay avatar
    3997 posts

    Posted 01 May 2008 Link to this post

    Hi ankool,

    The built-in context menus of the classic RadTreeView control does not support multi-level items. You should use RadMenu as a context menu of RadTreeView and apply it as shown in the following example:
    Rich Context Menu

    Hope this helps.

    Sincerely yours,
    Nick
    the Telerik team

    Instantly find answers to your questions at the new Telerik Support Center
  6. Greg
    Greg avatar
    10 posts
    Member since:
    Sep 2008

    Posted 29 Oct 2008 Link to this post

    Hi Nick,

    But according to the online example it does..."The built-in context menu of the treeview supports multi-level items. In other words, you can define root items, second level items, etc"

    How can I impliment a submenu on the "Send Now" menu seen below?

     

    <ContextMenus
     
    <telerik:RadTreeViewContextMenu ID="mnuMail" Skin="Outlook" runat="server"> 
     
    <CollapseAnimation Duration="200" Type="InOutQuint" /> 
     
    <Items
     
    <telerik:RadMenuItem runat="server" Text="Send Now" ImageUrl="~/Common/Images/Menu/Send.gif" Value="Send"> 
     
    </telerik:RadMenuItem
     
    </Items
     
    </telerik:RadTreeViewContextMenu>
    </ContextMenus>

     

     

     

  7. Veselin Vasilev
    Admin
    Veselin Vasilev avatar
    2992 posts

    Posted 29 Oct 2008 Link to this post

    Hello Greg,

    How about this:

    <ContextMenus>  
     <telerik:RadTreeViewContextMenu ID="mnuMail" Skin="Outlook" runat="server">  
     <CollapseAnimation Duration="200" Type="InOutQuint" />  
     <Items>  
     <telerik:RadMenuItem runat="server" Text="Send Now" ImageUrl="~/Common/Images/Menu/Send.gif" Value="Send">  
    <Items> 
       <telerik:RadMenuItem runat="server" Text="Send Now 1.1" >  
       </telerik:RadMenuItem>  
       <telerik:RadMenuItem runat="server" Text="Send Now 1.2" >  
       </telerik:RadMenuItem>  
    </Items> 
     </telerik:RadMenuItem>  
     </Items>  
     </telerik:RadTreeViewContextMenu> 
    </ContextMenus> 


    Regards,
    Veselin Vasilev
    the Telerik team

    Check out Telerik Trainer, the state of the art learning tool for Telerik products.
Back to Top
UI for ASP.NET Ajax is Ready for VS 2017