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. (Last updated on: November 16, 2018).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

Preventing DoubleClick expand node behavior in TreeNodeAdv?

Thread ID:

Created:

Updated:

Platform:

Replies:

27309 Apr 8,2005 09:46 PM UTC Apr 11,2005 07:31 PM UTC WinForms 1
loading
Tags: Tools
Administrator [Syncfusion]
Asked On April 8, 2005 09:46 PM UTC

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?

Administrator [Syncfusion]
Replied On April 11, 2005 07:31 PM UTC

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.

CONFIRMATION

This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

Warning Icon You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.Close Icon

;