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

RadTreeNode child node inherits root node context menu

3 Answers 48 Views
TreeView
This is a migrated thread and some comments may be shown as answers.
Marbry
Top achievements
Rank 1
Marbry asked on 30 Sep 2011, 08:18 PM
This was driving me nuts.  I have a child node several levels down in the tree that sometimes has no context menu on it.  It's about the only one that does.

When it didn't have a menu defined, well, it still had a menu.  I couldn't get rid of it even setting the ContextMenuID to an empty string.

I finally determined I could prevent that by setting it to something other than "", but that didn't corrrespond to an actual menu.  It appears that it was inheriting the menu of the root node since that's the only one that used that particular menu.

Easy to remedy, but extremely frustrating for a little while. 

3 Answers, 1 is accepted

Sort by
0
Plamen
Telerik team
answered on 05 Oct 2011, 10:53 AM
Hi Marbry,

Please  refer to our Context Menu demo where you can see how there a re two menus- MainContextMenu and EmptyFolderContextMenu. If you remove all the items of one of them but leave it like shown below for example no menu will be displayed:
<telerik:RadTreeViewContextMenu ID="EmptyFolderContextMenu" runat="server">
                       
                   </telerik:RadTreeViewContextMenu>

Hope this will be helpful.

Greetings,
Plamen Zdravkov
the Telerik team
If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to their blog feed now
0
Marbry
Top achievements
Rank 1
answered on 05 Oct 2011, 01:42 PM
So you're saying if I create a menu with no items in it, and assign that as a placeholder it will achieve the same result?

Like,
RadTreeViewContextMenu mnuPlaceholder = new RadTreeViewContextMenu();
mnuPlaceholder.ID = "PlaceholderMenu";

That's fine, I'm just surprised at the default behavior causing it to inherit that.  It's backwards from what I would expect.  I would think you would want to have to explicitly enable that.
0
Plamen
Telerik team
answered on 07 Oct 2011, 10:03 AM
Hello Marbry,

Yes, the default behavior is when the second ContextMenu is not defined for some nodes, the first contextmenu is taken.

Greetings,
Plamen Zdravkov
the Telerik team
If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to their blog feed now
Tags
TreeView
Asked by
Marbry
Top achievements
Rank 1
Answers by
Plamen
Telerik team
Marbry
Top achievements
Rank 1
Share this question
or