[Expand]General Information
[Collapse]WinForms Controls
 [Expand]What's Installed
 [Expand]Build an Application
 [Expand]Controls and Libraries
 [Collapse]Common Features
  [Expand]Data Binding Common Concepts
  [Expand]Data Source Wizard
    File and Folder Browser Behaviors
    Persistence Behavior
    Indicator Behaviors
    Stub Glyph Behavior
    Banner Behavior
    Breadcrumb Behavior
    Drag And Drop Behavior
    Magnifier Behavior
    Pager Navigation Behavior
    Scrollbar Annotation Behavior
    Snap Window Behavior
  [Expand]Application Appearance and Skin Colors
  [Expand]Filtering UI Context
  [Expand]High DPI Support
  [Expand]Scaffolding Wizard
  [Expand]Formatting Values
   HTML Text Formatting
  [Expand]Tooltip Management
  [Expand]Saving and Restoring Layouts
   Clipboard - Copy and Paste Operations. Data Formatting
   Version Compatibility: Default Property Values
  Get More Help
 [Expand]API Reference
[Expand]ASP.NET Controls and MVC Extensions
[Expand]ASP.NET Bootstrap Controls
[Expand]ASP.NET Core Bootstrap Controls
[Expand]WPF Controls
[Expand]Xamarin Controls
[Expand]Windows 10 App Controls
[Expand]Office File API
[Expand]Report and Dashboard Server
[Expand]eXpressApp Framework
[Expand]eXpress Persistent Objects
[Expand]CodeRush Classic
[Expand]Cross-Platform Core Libraries
[Expand]Tools and Utilities
 End-User Documentation
View this topic on docs.devexpress.com (Learn more)

Drag And Drop Behavior

The Drag and Drop Behavior allows you to add support for drag-and-drop operations between supported controls.

Supported controls

Behavior options

  • Target—specifies the control to which the behavior is attached;
  • PreviewVisible—specifies whether a preview of item(s) being dragged is displayed during operation;
  • InsertIndicatorVisible—specifies whether the indicator is showing items' insertion position;
  • AllowDrop—specifies whether the attached control allows an end-user to drop the item(s) on it.

The code below shows how to assign a Drag and Drop Behavior to a control using the BehaviorManager.Attach method and specify its options.


Drag and Drop Behaviors should be attached to the source and target controls to work correctly. Disable the source control's AllowDrop setting to allow data to be transferred one way only.


For a grid control with master-detail data presentation, attach a Drag and Drop Behavior to the main view (see GridControl.MainView).


Business objects must have a default constructor with no parameters if the behavior is attached to data-aware controls that store these objects defined in code. Otherwise, rows that display these objects cannot be moved between controls.

Behavior events

  • BeginDragDrop—occurs when a drag-and-drop operation starts allowing you to cancel the operation, or provide a custom preview image;
  • DragEnter—occurs when an object is dragged into the control's bounds;
  • DragOver—occurs when an object is dragged over the control's bounds;
  • DragLeave—occurs when an object is dragged out of the control's bounds;
  • DragDrop—occurs when a drag-and-drop operation is completed;
  • EndDragDrop—allows you to perform custom actions after a drag-and-drop operation is completed.

A DragDropEvents component is automatically added to your form when you attach a Drag and Drop Behavior to a control at design time. You can use this component to subscribe to the behavior's events.

When handling the drag and drop events for a grid view, use the following static (Shared in VB) methods to calculate GridView-specific arguments:

  • DragOverGridEventArgs.GetDragOverGridEventArgs—for the DragOver event;
  • DragDropGridEventArgs.GetDragDropGridEventArgs—for the DragDrop event.

When handling the drag-and-drop events for a tree list, use the Default method to calculate TreeList-specific arguments.


The Handled event argument should be set to true for event handlers to be in effect.

Is this topic helpful?​​​​​​​