New to Telerik UI for WPF? Download free 30-day trial

Auto Expand on Drag Over

RadTreeView offers you the ability to automatically expand a treeview node when dragging items over the node. In order to do that you need to perform the following action:

  • When dragging items over your treeview, move the mouse cursor over the treeview expander. The result will be an automatically expanded node.

The RadTreeView exposes a property DropExpandDelay, which sets the delay for the expand behavior. The property is of type TimeSpan. Here is a sample code showing you how to set it:

radTreeView.DropExpandDelay = TimeSpan.FromSeconds(5); 
radTreeView.DropExpandDelay = TimeSpan.FromSeconds(5) 

Disable Auto Expand on DragOver

The RadTreeView doesn't actually allow you to disable the auto-expand feature, however you can set the value of the DropExpandDelay property to represent a long period of time. This way your users won't trigger the auto-expand at all while dragging over an item. For instance you can set the DropExpandDelay to an hour:

<telerik:RadTreeView IsDragDropEnabled="True" DropExpandDelay="1:0:0"/> 
You can also set the value from code-behind:

radTreeView.DropExpandDelay = TimeSpan.FromMinutes(60);      
radTreeView.DropExpandDelay = TimeSpan.FromMinutes(60) 

See Also

In this article