Prevent Child Inheritence of a parents RadContextMenu

2 posts, 0 answers
  1. ithihas
    ithihas avatar
    14 posts
    Member since:
    Jun 2012

    Posted 12 Jul 2012 Link to this post

    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?

  2. Ivo
    Ivo avatar
    390 posts

    Posted 17 Jul 2012 Link to this post


    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,
    the Telerik team

    Explore the entire Telerik portfolio by downloading Telerik DevCraft Ultimate.

  3. DevCraft R3 2016 release webinar banner
Back to Top