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

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

5 Answers 337 Views
TreeView
This is a migrated thread and some comments may be shown as answers.
ankool
Top achievements
Rank 1
ankool asked on 01 May 2008, 10:39 AM
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.

5 Answers, 1 is accepted

Sort by
0
Nikolay
Telerik team
answered on 01 May 2008, 10:58 AM
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
0
ankool
Top achievements
Rank 1
answered on 01 May 2008, 11:09 AM

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.

0
Nikolay
Telerik team
answered on 01 May 2008, 11:28 AM
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
0
Greg
Top achievements
Rank 1
answered on 29 Oct 2008, 10:33 AM
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>

 

 

 

0
Veselin Vasilev
Telerik team
answered on 29 Oct 2008, 12:03 PM
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.
Tags
TreeView
Asked by
ankool
Top achievements
Rank 1
Answers by
Nikolay
Telerik team
ankool
Top achievements
Rank 1
Greg
Top achievements
Rank 1
Veselin Vasilev
Telerik team
Share this question
or