Scrolling Nodes

When the nodes in RadTreeView can't fit in the container, a vertical scroll bar appears so that they can be scrolled and later selected. The EnableMouseWheel property controls whether the scrolling behavior is enabled. By default, its value is set to true and the nodes can be scrolled by using the mouse wheel.

Scrolling Modes

The TreeViewElement supports three types of ScrollModes:

  • Discrete: Defines scrolling by only one item at a time.

  • Smooth: Sets scrolling by pixel, meaning that an item can be partially visible.

  • Deferred: Does not cause GUI updates until the user finishes the scrolling operation. A tooltip is shown indicating the position to which the view will scroll to.

Figure 3: Discrete Scrolling

treeview-scrolling003

Discrete Scrolling

this.radTreeView1.TreeViewElement.Scroller.ScrollMode = ItemScrollerScrollModes.Discrete;
Me.RadTreeView1.TreeViewElement.Scroller.ScrollMode = ItemScrollerScrollModes.Discrete

Figure 4: Smooth Scrolling

treeview-scrolling004

Smooth Scrolling

this.radTreeView1.TreeViewElement.Scroller.ScrollMode = ItemScrollerScrollModes.Smooth;
Me.RadTreeView1.TreeViewElement.Scroller.ScrollMode = ItemScrollerScrollModes.Smooth

Figure 5: Deferred Scrolling

treeview-scrolling005

Deferred Scrolling

this.radTreeView1.TreeViewElement.Scroller.ScrollMode = ItemScrollerScrollModes.Deferred;
Me.RadTreeView1.TreeViewElement.Scroller.ScrollMode = ItemScrollerScrollModes.Deferred

KineticScrolling

This feature ensures that the control is ready for modern touch-screen applications. It can be attached by simply setting the EnableKineticScrolling to true.

Figure 1: Enable Kinetic Scrolling

treeview-scrolling001

Enabling Kinetic Scrolling

this.radTreeView1.EnableKineticScrolling = true;
Me.RadTreeView1.EnableKineticScrolling = True

Programmatically Scrolling

RadDropDownList provides out of the box functionality for programmatically scrolling its content. The available method is ScrollToItem which scrolls to a specific item.

Figure 2: Scroll to Item

treeview-scrolling002

Scroll to Item

RadTreeNode lastRootNode = this.radTreeView1.TreeViewElement.Nodes[radTreeView1.Nodes.Count - 1];
this.radTreeView1.TreeViewElement.Scroller.ScrollToItem(lastRootNode);
Dim lastRootNode As RadTreeNode = Me.RadTreeView1.TreeViewElement.Nodes(radTreeView1.Nodes.Count - 1)
Me.RadTreeView1.TreeViewElement.Scroller.ScrollToItem(lastRootNode)
In this article
Not finding the help you need? Improve this article