[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
  [Expand]Data Grid
  [Expand]Vertical Grid
  [Expand]Property Grid
  [Expand]Pivot Grid
  [Expand]Tree List
  [Expand]Gantt Control
  [Expand]Chart Control
  [Expand]Map Control
    Getting Started
   [Expand]Data Binding
   [Expand]Import and Export
   [Expand]Time Zones
   [Expand]Visual Elements
    [Expand]Data Binding
    [Collapse]Data Exchange
      How to: Export Data to vCalendar
      How to: Import Data from vCalendar
      How to: Implement MS Outlook Data Exchange Operations
      How to: Modify Components of the Exported iCal Structure
      How to: Export Appointment as a Meeting Request with Attendees
      How to: Drag Appointments Data from the Grid onto a Scheduler
    [Expand]Date and Time
    [Expand]Gantt View
    [Expand]Labels and Statuses
    [Expand]Printing and Reporting
    [Expand]Range 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: Drag Appointments Data from the Grid onto a Scheduler

The following example demonstrates how to drag data for appointments from the GridControl and then drop it onto the SchedulerControl. This requires that all the appointment data is initially loaded into the Grid control. When an end-user drags this data and drops it onto a scheduler, a new appointment is created from that data.

To implement a solution for the drag-and-drop functionality, follow the steps below.

Expanded Handle the GridControl's MouseDown Event

The end-user selects a row by clicking in the grid. To obtain the selected row, use the following code that handles the BaseView.MouseDown event. The GridHitInfo object is stored in a variable for subsequent use.

Expanded Handle the GridControl's MouseMove Event

The BaseView.MouseMove event is handled to start the drag-and-drop operation. The DoDragDrop method of the GridControl is called.

Expanded Implement the Drag-and-Drop Operation

The data to drag is the SchedulerDragData instance that is created in the custom GetDragData method, which is implemented as follows:

Thus, a new appointment is created immediately when the mouse is over the SchedulerControl.

Expanded Prompt for Confirmation

When the end-user releases a mouse button and drops the appointment, the SchedulerControl.AppointmentDrop event occurs. Handle this event to show the confirmation dialog, as in the code snippet below.

Expanded Result

The application is shown in the picture below.

Expanded See Also

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