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

Prevent Child Inheritence of a parents RadContextMenu

1 Answer 25 Views
ContextMenu
This is a migrated thread and some comments may be shown as answers.
ithihas
Top achievements
Rank 1
ithihas asked on 12 Jul 2012, 07:28 AM
I Have a RadContextMenu in XAML in a RadTreeView that works fine. I dynamically load the tree items, and certain tree items I add a different Context menu, but it always opens the RadContextMenu in xaml. If I remove the xaml RadContextMenu ref, the dynamic ContextMenu loads.

So I guess is there a way to prevent every child from inheriting its parents context menu?

Thanks

1 Answer, 1 is accepted

Sort by
0
Ivo
Telerik team
answered on 17 Jul 2012, 12:00 PM
Hi,

For this scenario I would suggest you to generate the RadMenuItems into the RadContextMenu's Opening event depending on the clicked RadTreeViewItem. In order to get the clicked item you can use this code into the Opening event:
var item = this.radContextMenu.GetClickedElement<RadTreeViewItem>();

All the best,
Ivo
the Telerik team

Explore the entire Telerik portfolio by downloading Telerik DevCraft Ultimate.

Tags
ContextMenu
Asked by
ithihas
Top achievements
Rank 1
Answers by
Ivo
Telerik team
Share this question
or