We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date
close icon

TreeViewAdv Right Mouse Selection issue

I am using the TreeViewAdv Demo and remove the context menu from the tree. When you right click on a node (hold the mouse down), the selection changed to the node that you clicked on. Releasing the mouse will put the selection back to the old node. Is there anyway to make the selection changed to the new node, like the original TreeViewAdv demo with the context menu inplace?

1 Reply

AD Administrator Syncfusion Team November 11, 2004 11:36 PM UTC

Hi Patrick, Please refer to the test sample attached here that shows how you could accomplish the above by handling the TreeViewAdv''s MouseDown event as shown below : private void treeViewAdv1_MouseDown(object sender, System.Windows.Forms.MouseEventArgs e) { if (e.Button == MouseButtons.Right) { // get the point where the mouse was right clicked Point p = this.treeViewAdv1.PointToClient(Control.MousePosition); // get the node at the right click point TreeNodeAdv node = this.treeViewAdv1.PointToNode(p); // set the newly selected node this.treeViewAdv1.SelectedNode = node; } } Let me know if this works for you. Regards, Guru Patwal Syncfusion, Inc.

Loader.
Live Chat Icon For mobile
Up arrow icon