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

Preventing DoubleClick expand node behavior in TreeNodeAdv?

All, 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. Suggestions?

1 Reply

AD Administrator Syncfusion Team April 11, 2005 02:31 PM

Hi Keith, 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) { if (node.TextBounds.Contains(controlPoint)) { e.Cancel = true; } } } Please let me know if you have any questions regarding this technique. Regards, Gregory Austin Syncfusion Inc.

Loader.
Live Chat Icon For mobile
Up arrow icon