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

ContextMenu doesn't always display on RadTreeView nodes

1 Answer 79 Views
TreeView
This is a migrated thread and some comments may be shown as answers.
Ciaran
Top achievements
Rank 1
Ciaran asked on 16 Sep 2009, 02:13 PM
 Ok apologies if this should be in the RadMenu forum... please move thread if the issue is there.

The Context Menu doesn't always display on the treenode... sometimes the silverlight context menu appears (in IE) but in Chrome with same test neither menu appears!  I have the windowless= true set in the ASPX page.

My current app is quite large and it was difficult to figure out if it was a focus issue. I thought that maybe the tree had to have focus first ot maybe the individual node. I tested combinations of random left right clicking to no avail. So I created a test app to figure out what is going wrong. So I've found the problem I can provide it the sample project... it's easy to see & reproduce.

The behavior seems random... 80%+ the menu appears but sometimes the SL menu appears.

Ok... let me explain a little further. If I place the radmenu directly inside a RadTree then the menu pops up fine.
If I place it in the ItemTemplate then we have the issue.

I need to have a context menu for the items in the tree, not the tree itself & I'd guess most people are the same.

So after text and mucking around it boils down to this... if you have Grid with Column Definitions inside the ItemTemplate then the menu won't always appear. Use a stackpanel or absolute /margin based positioning to arrange Child Elements inside the template and all is good.

Support ticket for the sample?

1 Answer, 1 is accepted

Sort by
0
Valeri Hristov
Telerik team
answered on 17 Sep 2009, 11:16 AM
Hello Ciaran,

If you attach the context menu on an element in the item template of RadTreeView it will be displayed only when you click that element. It is possible that the theme you are using has a bug that prevents the items from stretching to the full treeview width. I suggest updating RadTreeView with our latest internal build and checking if this resolves the problem. If the problem persists, please, do not hesitate to contact us again.

I would recommend however, to use a single context menu for all treeview items, as shown in the blog post below:
http://blogs.telerik.com/valerihristov/posts/09-06-01/reusing_and_customizing_a_single_contextmenu_on_a_treeview_with_radcontrols_for_silverlight.aspx

Best wishes,
Valeri Hristov
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
Tags
TreeView
Asked by
Ciaran
Top achievements
Rank 1
Answers by
Valeri Hristov
Telerik team
Share this question
or