[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
  Prerequisites
 [Expand]What's Installed
 [Expand]Common Concepts
 [Expand]MVVM Framework
 [Collapse]Controls and Libraries
   Reporting
  [Collapse]Data Grid
   [Expand]Getting Started
   [Expand]Implementation Details
   [Expand]Views
   [Expand]Grid View Data Layout
   [Expand]Binding to Data
   [Expand]Master-Detail Data Representation
   [Expand]Data Editing and Validation
   [Expand]Grouping
   [Expand]Selection
   [Expand]Filtering and Searching
   [Expand]Sorting
   [Expand]Data Summaries
   [Expand]Paging and Scrolling
   [Expand]Focus and Navigation
   [Expand]Conditional Formatting
   [Collapse]Drag-and-Drop
     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
     Examples
   [Expand]Appearance Customization
   [Expand]MVVM Enhancements
   [Expand]Printing and Exporting
   [Expand]End-User Interaction
   [Expand]Miscellaneous
   [Expand]Performance Improvement
   [Expand]Design-Time Features
   [Expand]Visual Elements
   [Expand]End-User Capabilities
   [Expand]Examples
  [Expand]Ribbon, Bars and Menu
  [Expand]Charts Suite
  [Expand]Pivot Grid
  [Expand]Scheduler
  [Expand]Spreadsheet
  [Expand]Rich Text Editor
  [Expand]Tree List
  [Expand]Gauge Controls
  [Expand]Map Control
  [Expand]Layout Management
  [Expand]Windows Modern UI
  [Expand]Printing-Exporting
  [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
 [Expand]Localization
  Redistribution and Deployment
  Get More Help
 [Expand]API Reference
[Expand]Xamarin Controls
[Expand]Windows 10 App Controls
[Expand]Office File API
[Expand]Reporting
[Expand]Report and Dashboard Server
[Expand]Dashboard
[Expand]eXpressApp Framework
[Expand]eXpress Persistent Objects
[Expand]CodeRush
[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:

Tip

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?​​​​​​​