<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
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

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.
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

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>
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.