I have a question about how I should handle context menu generation. I'm including my treeview aspx below:
What I am trying to do is use those seperate context menus based on the level of the selected node. Basically limiting options on certain level nodes. I have tried numerous ways to get this to work and nothing has so far. It just displays the first context menu all the time.
I'm trying to handle the changes in this javascript method:
Is that even the correct event to handle it in? I don't really see any other choices.
Essentially I am just trying to do a switch on the selectedNode.LevelID which is an attribute that is 1-4 depending on the depth of the node.
Are there any examples anywhere? I have spent all day searching and trying to get this to work to no avail.
<telerik:RadTreeView ID="RadTreeView1" |
Runat="server" |
EnableDragAndDrop="True" |
EnableDragAndDropBetweenNodes="True" |
OnNodeDrop="RadTreeView_HandleDrop" |
OnClientNodeDropping="onNodeDropping" |
MultipleSelect="True" |
OnClientNodeDragging="onNodeDragging" |
AllowNodeEditing="True" |
OnContextMenuItemClick="RadTreeView_ContextMenuItemClick" |
OnClientContextMenuItemClicking="onClientContextMenuItemClicking" |
OnNodeDataBound="RadTreeView_OnNodeDataBound" |
OnClientContextMenuShowing="onClientContextMenuShowing" |
OnNodeEdit="RadTreeView_NodeEdit" |
DataTextField="Text"> |
<ContextMenus> |
<telerik:RadTreeViewContextMenu ID="PartMenu" runat="server"> |
<Items> |
<telerik:RadMenuItem Value="Copy" Text="Copy Part" /> |
<telerik:RadMenuItem Value="Edit" Text="Edit Part" /> |
<telerik:RadMenuItem Value="Delete" Text="Delete Part" /> |
<telerik:RadMenuItem Value="Properties" Text="Properties" /> |
</Items> |
</telerik:RadTreeViewContextMenu> |
<telerik:RadTreeViewContextMenu ID="SectionMenu" runat="server"> |
<Items> |
<telerik:RadMenuItem Value="Add" Text="Add Category" /> |
</Items> |
</telerik:RadTreeViewContextMenu> |
<telerik:RadTreeViewContextMenu ID="CategoryMenu" runat="server"> |
<Items> |
<telerik:RadMenuItem Value="Add" Text="Add Subcategory" /> |
<telerik:RadMenuItem Value="Delete" Text="Delete Subcategory" /> |
<telerik:RadMenuItem Value="Properties" Text="Properties" /> |
</Items> |
</telerik:RadTreeViewContextMenu> |
<telerik:RadTreeViewContextMenu ID="SubCategoryMenu" runat="server"> |
<Items> |
<telerik:RadMenuItem Value="Delete" Text="Delete Subcategory" /> |
<telerik:RadMenuItem Value="Properties" Text="Properties" /> |
</Items> |
</telerik:RadTreeViewContextMenu> |
</ContextMenus> |
</telerik:RadTreeView> |
What I am trying to do is use those seperate context menus based on the level of the selected node. Basically limiting options on certain level nodes. I have tried numerous ways to get this to work and nothing has so far. It just displays the first context menu all the time.
I'm trying to handle the changes in this javascript method:
function
onClientContextMenuShowing(sender, args)
Is that even the correct event to handle it in? I don't really see any other choices.
Essentially I am just trying to do a switch on the selectedNode.LevelID which is an attribute that is 1-4 depending on the depth of the node.
Are there any examples anywhere? I have spent all day searching and trying to get this to work to no avail.