[Expand]General Information
[Collapse]WinForms Controls
  .NET Core Support
 [Expand]What's Installed
 [Expand]Build an Application
 [Collapse]Controls and Libraries
  [Expand]Forms and User Controls
  [Expand]Messages, Notifications, and Dialogs
  [Expand]Editors and Simple Controls
  [Expand]Ribbon, Bars and Menu
  [Expand]Application UI Manager
  [Expand]Docking Library
  [Collapse]Data Grid
   [Expand]Get Started With Data Grid and Views
   [Expand]Data Binding
    Unbound Columns
   [Expand]Data Editing and Validation
   [Expand]Filter and Search
   [Expand]Focus and Selection Handling
    Format Cell Values
   [Expand]Master-Detail Relationships
   [Expand]Asynchronous Image Load
   [Expand]Export and Printing
   [Expand]Appearance and Conditional Formatting
    Split Presentation
    Row Preview Sections
   [Expand]Batch Modifications
    Hit Information
    Popup Menus
   [Expand]Save and Restore Layout
   [Expand]Visual Elements
   [Expand]Design-Time Features
    [Expand]Conditional Formatting
    [Expand]Data Binding
    [Expand]Data Editing
    [Expand]Data Presentation
    [Expand]Export and Printing
    [Expand]General Use
    [Expand]Layout View
      Examples: Master-Detail Mode
      How to: Bind GridControl to a DataBase and Implement Master-Detail Mode at Runtime
      How to: Expand and Maximize a Specific Detail
      How to: Implement Card Dragging Between Details
      How to: Replace a View Used to Represent a Specific Master-Detail Relationship
      What Can Cause Properties, Methods, and Events of a Detail View to Fail?
    [Expand]Navigation and Selection
    [Expand]Skins and Look and Feel
    [Expand]Sorting and Grouping
   [Expand]End-User Capabilities
    Included Components
  [Expand]Vertical Grid
  [Expand]Property Grid
  [Expand]Pivot Grid
  [Expand]Tree List
  [Expand]Gantt Control
  [Expand]Chart Control
  [Expand]Map Control
  [Expand]Rich Text Editor
  [Expand]Spell Checker
  [Expand]Form Layout Managers
  [Expand]Navigation Controls
  [Expand]PDF Viewer
  [Expand]TreeMap Control
  [Expand]Sunburst Control
 [Expand]Common Features
  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)

How to: Implement Card Dragging Between Details

The following example assumes that we have a master-detail relationship within the grid control. The master View is represented by a GridView and the detail Views are represented by instances of the CardView class. This example shows how to implement card dragging between details.

The System.Windows.Forms.Control.MouseDown event is used to identify the clicked card and initiate the drag operation. Then, the System.Windows.Forms.Control.DragOver event is used to determine whether dropping is allowed. The GridControl.GetViewAt method is used to obtain the View currently located under the mouse pointer. If the View obtained is a detail View (a Card View), dropping is allowed.

Finally, the System.Windows.Forms.Control.DragDrop event is used to determine the View where the card has been dropped (the GridControl.GetViewAt method is used again). Then, the dragged card is moved to that View by changing its field value that refers to the master record.

Note: to enable dropping you should set the grid control's AllowDrop property value to true.

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