Log In
[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
    Drag And Drop 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]Tooltip Management
  [Expand]Saving and Restoring Layouts
   Clipboard - Copy Data and 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]WPF Controls
[Expand]Xamarin Controls
[Expand]Windows 10 App Controls
[Expand]Document Server
[Expand]Report Server
[Expand]eXpressApp Framework
[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, invoke the Behaviors Collection Editor by clicking the Edit Behaviors link in the ListBoxControl's smart tag menu. The invoked editor allows you to add/remove the 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 that the Drag And Drop Behavior must be attached to both controls, the source, and the target, for the functionality to work.

Code sample

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