TreeNode context menu item click event

2 posts, 0 answers
  1. Nisi
    Nisi avatar
    12 posts
    Member since:
    May 2007

    Posted 18 Mar 2008 Link to this post


    i have a RadTreeView with several nodes being added dynamically. on each node i am assigning the same context menu. in the click event for the items on the menu i need to know which node was right-clicked. how can i determine this?
  2. Jordan
    Jordan avatar
    547 posts

    Posted 19 Mar 2008 Link to this post

    Hi Mac & Cheese,

    The most secure way to get the node for which the context menu is shown is to use the ContextMenuShowing event.

    Refer to the code below:

    public Form1() 
        this.radTreeView1.ContextMenuShowing += new CancelEventHandler(radTreeView1_ContextMenuShowing); 
    private RadTreeNode contextNode = null
    void radTreeView1_ContextMenuShowing(object sender, CancelEventArgs e) 
        this.contextNode = sender as RadTreeNode; 

    If you have any other questions or suggestions about RadTreeView do not hesitate to write me.

    the Telerik team

    Instantly find answers to your questions at the new Telerik Support Center
Back to Top