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.
Syncfusion Feedback

How can i get checked Nodes and Child nodes separately using Treeviewadv into different lists??

Thread ID:

Created:

Updated:

Platform:

Replies:

116554 Jun 9,2014 12:34 PM UTC Jun 10,2014 10:30 AM UTC WinForms 1
loading
Tags: TreeViewAdv
Narry
Asked On June 9, 2014 12:34 PM UTC

i tried with this code.. 
i'm getting all the nodes which are checked into one list...
List<String> aResult = new List<String>();
            foreach (Syncfusion.Windows.Forms.Tools.TreeNodeAdv aNode in treeViewAdv1.Nodes)
                {
                    if (aNode.Checked)
                    {
                        aResult.Add(aNode.Text);
                    }
                    aResult.AddRange(CheckedNames(aNode.Nodes));
                }

Senthil Kumaran Rajan [Syncfusion]
Replied On June 10, 2014 10:30 AM UTC

Hi Narry,

 

Thank you for using Syncfusion Product,

 

We would like to let you know that your requirement in "Treeviewadv" can be achieved by creating another list. In the sample provided, we have found that only a single list has been maintained due to the nodes which have been  checked into that list. We have prepared a sample to achieve your query. Please have the sample attached below.

  

Code Snippet[C#] : To get a child node in the list.

 

  List<String> child = new List<String>();

  for (int n = 0; n < treeViewAdv1.Nodes.Count; n++)

                {

                    foreach (TreeNodeAdv childnode in treeViewAdv1.Nodes[n].Nodes)

                    {

                        if (childnode.Checked)

                        {

                            child.Add(childnode.Text);

                        }

                    }

                }            

 

 

Please let us know if you have any concerns,

 

Regards,

Senthil kumaran
Attachment: tree1_9b1a0d79.zip

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.

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

;