Drag and Drop Overview

The drag and drop feature of the file dialogs allows you to grab items (file and folders) and move them to a different location. The feature supports copy and move operations and it is enabled by default.

Telerik UI for WPF Ninja image

The Drag and Drop is part of Telerik UI for WPF, a professional grade UI library with 160+ components for building modern and feature-rich applications. To try it out sign up for a free 30-day trial.

Figure 1: Drag drop files

WPF RadFileDialogs Drag drop files

The dialog gives you the ability to drag and drop in the main pane and the tree navigation pane, and also between them.

Copy Drag vs. Move Drag

The default drag operation is move, except you drag an item to another drive. So, if you drag a file/folder and then drop it, the item will be moved to the new location. To start a copy drag you will need to press and hold the Ctrl modifier key.

Dragging an item to another drive will copy it there. To change the operation you can hold the Shift key while dropping.

You can also alter between copy and move in the middle of the drag/drop operation by pressing Ctrl. In other words, you can start dragging without pressing the Ctrl key, and just before drop you can press the key, thus changing the type of the operation.

Enable and Disable Drag and Drop

To enable or disable the feature you can use the IsDragDropEnabled property of the file dialog.

Example 1: Disabling drag and drop

RadSaveFileDialog saveFileDialog = new RadSaveFileDialog();  
saveFileDialog.Owner = theOwnerWindow;   
saveFileDialog.IsDragDropEnabled = false;    

Customizing Drag and Drop

You can customize the drag drop behavior and also the drag visual element. Read more about this in the Customizing the Drag Drop Behavior and Customizing the Drag Visual articles.

See Also

In this article