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

Selection of Nodes

Thread ID:





42915 Apr 10,2006 12:12 PM UTC Apr 10,2006 01:47 PM UTC WinForms 1
Tags: Tools
Administrator [Syncfusion]
Asked On April 10, 2006 12:12 PM UTC

Hi I want to allow the user to select only certain nodes in treeview. I used args.cancel in BeforeSelect event, but it failed to work. I want only certain nodes to get selected and the others should have dotted rectangle. Thanks, Ben

Deepa TS [Syncfusion]
Replied On April 10, 2006 01:47 PM UTC

Hi Ben, You could allow the user to select only certain nodes and the make only the selectable nodes get selected, while the non-selectable nodes just have a dotted rectangle around them and are not selected by handling TreeViewAdv AfterSelect event handler. Code: private void treeViewAdv1_AfterSelect(object sender, System.EventArgs e) { TreeNodeAdv node =this.treeViewAdv1.SelectedNode; if ((node.Text == "Node0") || (node.Text == "Node2") || (node.Text == "Node4") || (node.Text == "Node6")|| (node.Text == "Node8")) { this.treeViewAdv1.SelectedNodes.Remove(node); } } Please take a look at the attached sample and let me know if I have understood your problem correctly. SkipSelection Thanks for your interest in Syncfusion products. Regards, Deepa.


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.

Please sign in to access our forum

This page will automatically be redirected to the sign-in page in 10 seconds.

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