AD
Administrator
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.