How do I attach a context menu to a TreeViewItem?

2 posts, 0 answers
  1. Grant
    Grant avatar
    164 posts
    Member since:
    Jul 2016

    Posted 14 Sep Link to this post

    Hi, 

    I would like to display a context menu (similar to https://www.telerik.com/kendo-react-ui/components/layout/menu/context-menu/) when I right click on an item in a TreeView (https://www.telerik.com/kendo-react-ui/components/treeview/). The context menu should be aware of the relevant TreeViewItem that was right clicked on e.g. so I can perform an edit or delete. Is this possible?

    Thanks, 
    Grant

  2. Stefan
    Admin
    Stefan avatar
    2894 posts

    Posted 15 Sep Link to this post

    Hello, Grant,

    This can be done by using the TreeView items custom rendering to attach and onContextMenu event over them and dynamically show a Popup component with a Menu over the item:

    https://www.telerik.com/kendo-react-ui/components/treeview/custom-rendering/

    I have also attached a project that showcases this.

    Regards,
    Stefan
    Progress Telerik

    Virtual Classroom, the free self-paced technical training that gets you up to speed with Telerik and Kendo UI products quickly just got a fresh new look + new and improved content including a brand new Blazor course! Check it out at https://learn.telerik.com/.

Back to Top