The Syncfusion native Blazor components library offers 70+ UI and Data Viz web controls that are responsive and lightweight for building modern web apps.
.NET PDF framework is a high-performance and comprehensive library used to create, read, merge, split, secure, edit, view, and review PDF files in C#/VB.NET.
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?
ADAdministrator Syncfusion Team 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.