[Expand]General Information
[Expand]WinForms Controls
[Expand]ASP.NET Controls and MVC Extensions
[Expand]ASP.NET Bootstrap Controls
[Expand]ASP.NET Core Bootstrap Controls
[Collapse]WPF Controls
 [Expand]What's Installed
 [Expand]Common Concepts
 [Expand]MVVM Framework
 [Collapse]Controls and Libraries
  [Collapse]Data Grid
   [Expand]Getting Started
   [Expand]Implementation Details
   [Expand]Grid View Data Layout
   [Expand]Binding to Data
   [Expand]Master-Detail Data Representation
   [Expand]Data Editing and Validation
   [Expand]Filtering and Searching
   [Expand]Data Summaries
   [Expand]Paging and Scrolling
   [Expand]Focus and Navigation
   [Expand]Conditional Formatting
     Drag-and-Drop Options
    [Collapse]Process Drag-and-Drop Operations
      Drag-and-Drop Between GridControl and ListBoxEdit
      Drag-and-Drop Between GridControls
      Drag-and-Drop Between GridControl and Other Controls
      Drag-and-Drop Between Applications
     Drag-and-Drop Hint
     Drop Marker
     Drag-and-Drop Managers
     Move Nodes in TreeList
   [Expand]Appearance Customization
   [Expand]MVVM Enhancements
   [Expand]Printing and Exporting
   [Expand]End-User Interaction
   [Expand]Performance Improvement
   [Expand]Design-Time Features
   [Expand]Visual Elements
   [Expand]End-User Capabilities
  [Expand]Ribbon, Bars and Menu
  [Expand]Charts Suite
  [Expand]Pivot Grid
  [Expand]Rich Text Editor
  [Expand]Tree List
  [Expand]Gauge Controls
  [Expand]Map Control
  [Expand]Layout Management
  [Expand]Windows Modern UI
  [Expand]Data Editors
  [Expand]Navigation Controls
  [Expand]Spell Checker
  [Expand]Property Grid
  [Expand]PDF Viewer
  [Expand]TreeMap Control
  [Expand]Gantt Control
  [Expand]Diagram Control
  [Expand]Windows and Utility Controls
   Dialogs, Notifications and Panels
  [Expand]Scheduler (legacy)
 [Expand]Scaffolding Wizard
  Redistribution and Deployment
  Get More Help
 [Expand]API Reference
[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 Between GridControl and ListBoxEdit

The GridControl allows dragging records and dropping them in external controls. This topic demonstrates how to implement drag-and-drop between the GridControl and the ListBoxEdit.

The following image shows dragging records to and from the ListBoxEdit:


A complete sample project is available in the DevExpress Code Examples database at http://www.devexpress.com/example=T566433.

Follow the steps below to implement drag-and-drop between the GridControl and the ListBoxEdit:

  1. Add the GridControl and the ListBoxEdit to your project's window:

  2. Activate drag-and-drop operations in the added controls:

  3. Now you can drag records but not drop them in another control. Do the following steps to allow dropping:

  4. The controls in the demonstrated example have the same data source type. If data source types are different:

    • Handle the DataViewBase.DropRecord event on the GridControl to modify data that is dragged from the ListBoxEdit.
    • Handle the DevExpress.Xpf.Core.ListBoxDragDropBehavior.DropRecord attached event on the ListBoxEdit to modify data that are dragged from the GridControl.

    See the DataViewBase.DropRecord event implementation in the Drag-and-Drop Between GridControl and Other Controls topic to learn how to modify the dragged data.

Expanded See Also

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