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.

Selecting all the leaf nodes of the parent node

Thread ID:

Created:

Updated:

Platform:

Replies:

39953 Jan 21,2006 03:00 AM Jan 31,2006 01:14 AM Windows Forms 2
loading
Tags: Tools
Administrator [Syncfusion]
Asked On January 21, 2006 03:00 AM

Hi forum, Will I be able to select all the leaf nodes of the parent node if I only select the parent node. Any ideas that will be helpful for me?!!! Thanks, Regards, Peter.

Deepa TS [Syncfusion]
Replied On January 23, 2006 05:15 AM

Hi Peter, You can select all the leaf nodes of the parent node by only selecting the parent node by handling the AfterSelect Event handler. private void treeViewAdv1_AfterSelect(object sender, System.EventArgs e) { TreeNodeAdvCollection tn = new TreeNodeAdvCollection(); foreach (TreeNodeAdv n in this.treeViewAdv1.SelectedNodes) { this.AddChildren(tn, n); } foreach (TreeNodeAdv n in tn) { this.treeViewAdv1.SelectedNodes.Add(n); } } private void AddChildren(TreeNodeAdvCollection tn, TreeNodeAdv n) { foreach (TreeNodeAdv child in n.Nodes) { tn.Add(child); this.AddChildren(tn, child); } } Please take a look at the attached sample and let me know if this helps you. Thanks for your interest in Syncfusion products. Regards, Deepa.T.S

LeafNodes.zip

Administrator [Syncfusion]
Replied On January 31, 2006 01:14 AM

It helped me. Thanx!!

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.

;