)
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: June 24, 2019).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

How to scroll to particular TreeNodeAdv programmatically in WinForms TreeViewAdv?

Platform: WinForms |
Control: TreeViewAdv |
Published Date: June 2, 2015 |
Last Revised Date: February 5, 2020

Selection node

In the TreeViewAdv, to scroll a particular TreeNodeAdv or to ensure that it is visible programmatically, you can use the functions BringIntoView and EnsureVisible.

C#

//Shows the parent node of the selected node.
this.treeViewAdv1.SelectedNode.Parent.BringIntoView();
//Shows the particular node.
this.treeViewAdv1.Nodes[0].Nodes[this.treeViewAdv1.Nodes[0].Nodes.Count - 1].BringIntoView();
//EnsureVisible function also used to show the parent node of the selected node.
this.treeViewAdv1.EnsureVisible(treeViewAdv1.SelectedNode.Parent);

VB

'Shows the parent node of the selected node.
Me.treeViewAdv1.SelectedNode.Parent.BringIntoView()
'Shows the particular node.
Me.treeViewAdv1.Nodes(0).Nodes(Me.treeViewAdv1.Nodes(0).Nodes.Count - 1).BringIntoView()
'EnsureVisible function also used to show the parent node of the selected node
Me.treeViewAdv1.EnsureVisible(treeViewAdv1.SelectedNode.Parent)
'EnsureVisible function also used to show the particular node
Me.treeViewAdv1.EnsureVisible(Me.treeViewAdv1.Nodes(0).Nodes(treeViewAdv1.Nodes(0).Nodes.Count - 1))

 

Show the scrolling view and selected the particular node

Samples:

C#: http://www.syncfusion.com/downloads/support/directtrac/129875/ze/TreeViewAdv_BringIntoView-1537746265

VB: http://www.syncfusion.com/downloads/support/directtrac/129875/ze/TreeViewAdv_BringIntoView_VB-360800057

Reference link: https://help.syncfusion.com/windowsforms/treeview/treenodeadvcustomization#nodeselection

2X faster development

The ultimate WinForms UI toolkit to boost your development speed.
ADD COMMENT
You must log in to leave a comment

Please sign in to access our KB

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

Up arrow icon

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

Live Chat Icon For mobile
Live Chat Icon