Log In
Home
Support
Demos
Documentation
Blogs
Training
Webinars
[Expand]General Information
[Collapse]WinForms Controls
  Prerequisites
 [Expand]What's Installed
 [Expand]Build an Application
 [Expand]Controls and Libraries
 [Collapse]Common Features
  [Expand]Data Binding Common Concepts
  [Expand]Data Source Wizard
  [Expand]Expressions
  [Collapse]Behaviors
    File and Folder Browser Behaviors
    Persistence Behavior
    Indicator Behaviors
    Stub Glyph Behavior
    Banner Behavior
    Drag And Drop Behavior
    Magnifier Behavior
    Snap Window Behavior
  [Expand]Application Appearance
  [Expand]Filtering UI Context
  [Expand]High DPI Support
  [Expand]Scaffolding Wizard
  [Expand]Formatting Values
   HTML Text Formatting
  [Expand]Menus
  [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]Document Server
[Expand]Reporting
[Expand]Report Server
[Expand]Dashboard
[Expand]eXpressApp Framework
[Expand]CodeRush
[Expand]CodeRush Classic
[Expand]Cross-Platform Core Libraries
[Expand]Tools and Utilities
 End-User Documentation

Drag And Drop Behavior

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

Supported controls

Behavior options

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

Using in Windows Forms Designer

In the Windows Forms Designer, click the control's smart tag and invoke the Add Behaviors (or Edit Behaviors) command. This opens the Behaviors Collection Editor that allows you to add/remove a Drag And Drop Behavior, and customize its properties. See the figure below.

You can also use the BehaviorManager component to customize behaviors on your form. See the diagram below.

Note

Drag And Drop Behaviors must be attached to both controls, the source, and the target, for the functionality to work. To allow data to be transferred only one way, disable the AllowDrop setting for the source control.

Code sample

How would you rate this topic?​​​​​​​