New to Telerik UI for WinForms? Start a free 30-day trial
Bring a Node into View
Updated over 6 months ago
In cases where you have a tree view with many nodes and limited space on the form, you need to scroll the control in order to find a specific node. RadTreeView control handles this automatically for you. To scroll the control to a node use the BringIntoView method.
C#
RadTreeNode lastRootNode = radTreeView1.Nodes[radTreeView1.Nodes.Count - 1];
radTreeView1.BringIntoView(lastRootNode.Nodes[lastRootNode.Nodes.Count - 1]);
The BringIntoView method does not select the node!
The RadTreeViewElement class defines an AutoScrollOnClick property which is by default set to true. This property determines whether to scroll horizontally the control ensuring that the clicked node is visible.