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

TreeView ContextMenu when tree empty

3 Answers 83 Views
TreeView
This is a migrated thread and some comments may be shown as answers.
Alan Sauls
Top achievements
Rank 1
Alan Sauls asked on 23 Feb 2010, 10:29 PM
How do I suppress the displaying of the contextmenu when a treeview is empty?

3 Answers, 1 is accepted

Sort by
0
Tina Stancheva
Telerik team
answered on 01 Mar 2010, 10:05 AM
Hi Alan Sauls,

Can you please elaborate on the issue. Do you want to hide a custom context menu that you have created or you want to disable the default Silverlight context menu?

If you can send us a small sample application which illustrates your problem exactly we will be able to debug it locally and provide you with a solution.

Regards,
Tina Stancheva
the Telerik team

Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items.
0
Alan Sauls
Top achievements
Rank 1
answered on 01 Mar 2010, 07:17 PM
Since I was connecting the contextmenu to a hierarchicaldatatemplate I needed to use  the solution here:  http://www.telerik.com/help/wpf/radtreeview-how-to-add-context-menu.html

0
Kiril Stanoev
Telerik team
answered on 02 Mar 2010, 12:06 PM
Hello Alan,

We are still not sure that we understand what exactly the problem is. The link you have posted in your previous post (http://www.telerik.com/help/wpf/radtreeview-how-to-add-context-menu.html) was for WPF whereas your forum thread is for Silverlight. Which exactly is your target platform since there are differences between using context menu in Silverlight and WPF?
Additionally, if you are targeting WPF and you have added context menu to your HierarchicalDataTemplate, there should be no reason to see a context menu appearing if the treeview is empty. Please take a look at the attached sample project.
Let us know how we can be of further reference.

Kind regards,
Kiril Stanoev
the Telerik team

Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items.
Tags
TreeView
Asked by
Alan Sauls
Top achievements
Rank 1
Answers by
Tina Stancheva
Telerik team
Alan Sauls
Top achievements
Rank 1
Kiril Stanoev
Telerik team
Share this question
or