Log In
Home
Support
Demos
Documentation
Blogs
Training
Webinars
[Expand]General Information
[Collapse]WinForms Controls
  Prerequisites
 [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]Pivot Grid
  [Expand]Tree List
  [Expand]Chart Control
  [Expand]Diagrams
  [Expand]Gauges
  [Expand]Map Control
  [Collapse]Scheduler
   [Expand]Product Information
   [Expand]Getting Started
   [Expand]Fundamentals
   [Expand]Visual Elements
   [Expand]Design-Time Features
   [Collapse]Examples
    [Expand]Appearance
    [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]DateTime
    [Expand]DateNavigator
    [Expand]Forms
    [Expand]Gantt View
    [Expand]Initialization
    [Expand]Labels and Statuses
    [Expand]Layout
    [Expand]Menu
    [Expand]Printing and Reporting
    [Expand]Protection
    [Expand]Range Control
    [Expand]Recurrence
    [Expand]Reminders
    [Expand]Selection
   [Expand]End-User Capabilities
   [Expand]Member Tables
  [Expand]Spreadsheet
  [Expand]Rich Text Editor
  [Expand]Spell Checker
  [Expand]Form Layout Managers
  [Expand]Navigation Controls
  [Expand]Printing-Exporting
  [Expand]PDF Viewer
   Reporting
  [Expand]Snap
  [Expand]TreeMap Control
 [Expand]Common Features
  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]Reporting
[Expand]Report Server
[Expand]Dashboard
[Expand]eXpressApp Framework
[Expand]CodeRush
[Expand]Cross-Platform Core Libraries
[Expand]Tools and Utilities
 End-User Documentation

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.

Show Me

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

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.

Show Me

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

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:

Show Me

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

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.

Show Me

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

Expanded Result

The application is shown in the picture below.

Expanded See Also

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