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

Programatically selecting all the nodes in the treeview adv....

Thread ID:

Created:

Updated:

Platform:

Replies:

39410 Jan 6,2006 10:36 AM UTC Jan 10,2006 11:30 AM UTC WinForms 4
loading
Tags: Tools
Jane
Asked On January 6, 2006 10:36 AM UTC

Hi forum, I am workin in treeviewadv, just dropped by to know whether there is any way to programatically select all the nodes in the treeview adv... Thanks in advance. Regards, Jane

Deepa TS [Syncfusion]
Replied On January 6, 2006 02:12 PM UTC

Hi Jane, You can programatically select all the nodes in the treeViewAdv with the help of following code snippet. private void button1_Click(object sender, System.EventArgs e) { this.treeViewAdv1.ExtendSelectionTo(this.treeViewAdv1.LastVisibleNode); this.treeViewAdv1.Focus(); } Please take a look at the attached sample and let me if this helps you. Thanks for using syncfusion products. Regards, Deepa.T.S

SelectAllnodes.zip

Administrator [Syncfusion]
Replied On January 9, 2006 12:05 PM UTC

Hi Deepa, I need to select all the nodes, not only the visible nodes in the tree. Is there a way. Thanks in advance. Regards, Jane

Deepa TS [Syncfusion]
Replied On January 9, 2006 01:15 PM UTC

Hi Jane, Sorry for the inconvenience caused.I do see that the nodes that are not present in the visible area do not get selected. To solve this problem, please use the following code snippet. private void button1_Click(object sender, System.EventArgs e) { foreach (TreeNodeAdv node in this.treeViewAdv1.Root.Nodes) { this.treeViewAdv1.SelectedNodes.Add(node); TreeNodeAdv lastNode = node.LastNode; while (lastNode != null) { this.treeViewAdv1.ExtendSelectionTo(lastNode); lastNode = lastNode.LastNode; } } this.treeViewAdv1.Focus(); } Please take a look at the modified attached sample,and let me know if this meets your requirements. Thanks for your continued interest in Syncfusion products. Regards, Deepa.T.S

SelectAllnodes0.zip

Administrator [Syncfusion]
Replied On January 10, 2006 11:30 AM UTC

It works!!!

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.

Please sign in to access our forum

or the page will be automatically redirected to 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

;