I would like to prevent the default "expand node" behavior that occurs when a node is double-clicked. I have my own tree derived from TreeViewAdv, and have tried overriding/newing OnDoubleClick, but the node keeps expanding.
ADAdministrator Syncfusion Team April 11, 2005 02:31 PM
You can prevent a Node from expanding by handling the BeforeExpand event. Preventing the node from expanding when clicked on is demonstrated by the following code snippet:
private void treeViewAdv1_BeforeExpand(object sender, Syncfusion.Windows.Forms.Tools.TreeViewAdvCancelableNodeEventArgs e)
Point controlPoint = this.treeViewAdv1.PointToClient(Control.MousePosition);
TreeNodeAdv node = this.treeViewAdv1.GetNodeAtPoint(controlPoint, true);
if (node != null)
e.Cancel = true;
Please let me know if you have any questions regarding this technique.