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?
ADAdministrator Syncfusion Team November 11, 2004 06:36 PM
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.