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.
Unfortunately, activation email could not send to your email. Please try again.

Selection of Nodes

Thread ID:

Created:

Updated:

Platform:

Replies:

42915 Apr 10,2006 08:12 AM Apr 10,2006 09:47 AM Windows Forms 1
loading
Tags: Tools
Administrator [Syncfusion]
Asked On April 10, 2006 08:12 AM

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 09:47 AM

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.

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.

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.

;