[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].NET Core 3 Support
 [Expand]Common Concepts
 [Expand]MVVM Framework
 [Collapse]Controls and Libraries
   Reporting
  [Expand]Data Grid
  [Expand]Ribbon, Bars and Menu
  [Expand]Charts Suite
  [Expand]Pivot Grid
  [Collapse]Scheduler
   [Expand]Getting Started
   [Expand]Appointments
    Resources
    Reminders
    Time Regions
   [Expand]Views
   [Expand]Visual Elements
   [Expand]Styles and Templates
   [Expand]Design-Time Features
    Time Zones
   [Expand]Data Binding
    Appearance Customization
    Grouping
    Selecting
    Clipboard Operations
    Printing Templates
    Drag and Drop Customization
    Navigating
    Printing
    End-User Restrictions
   [Expand]Examples
    Migration Guidelines
  [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 Customization

Expanded Drag and Drop Events

Starting with v19.1, the SchedulerControl (see SchedulerControl) provides events that allow you to control drag and drop operations at all stages. The image below illustrates the drag-drop event flow.

The SchedulerControl.StartAppointmentDrag event occurs when the user starts dragging selected Scheduler appointments. The following three events are fired repeatedly while the user drags appointments within a Scheduler's view:

Setting the SchedulerControl.QueryContinueAppointmentDrag's Action property to Drop raises the SchedulerControl.DropAppointment event, which allows you to customize the drop behavior.

If the SchedulerControl.QueryContinueAppointmentDrag's Action property is set to Cancel, the SchedulerControl.DropAppointment event is skipped.

The SchedulerControl.CompleteAppointmentDragDrop event occurs when a drag-drop operation initialized within the Scheduler has been completed.

When the user initiates dragging from outside the Scheduler, the SchedulerControl.StartAppointmentDrag event does not fire. The SchedulerControl.StartAppointmentDragFromOutside event occurs instead. Only the SchedulerControl.DragAppointmentOver event is raised repeatedly while the user drags appointments within a view. The SchedulerControl.CompleteAppointmentDragDrop event does not fire in this scenario.

Tip

The SchedulerControl.AppointmentDrag and SchedulerControl.AppointmentDrop events are obsolete. If you try to simultaneously handle any of these two events and the events listed above, the SchedulerControl throws an exception.

Expanded Restricting Drag and Drop Operations

The Scheduler control provides options and events that allow you to control drag-and-drop operations.

Property Description
SchedulerControl.AllowAppointmentDrag Controls the end-user's capability to drag and drop appointments to another location (time slot or date). You can override this global behavior by handling the SchedulerControl.CustomAllowAppointmentDrag event.
SchedulerControl.AllowAppointmentDragBetweenResources Allows you to restrict dragging appointments to another resource area only.
SchedulerControl.AllowAppointmentConflicts Allows you to restrict dragging appointments to the time interval another appointment occupies.
SchedulerControl.AppointmentDragMode Specifies how an appointment fits in the time cell(s) when dragged to another time interval.
SchedulerControl.KeepResourceDistanceOnAppointmentDrag Specifies whether the scheduler puts all dragged appointments into the same target resource or tries to keep their original distribution.

The SchedulerControl.CustomAllowAppointmentDrag event fires when the end-user attempts to drag the appointment to another time interval. Use this event to specify a particular case when the end-user can drag an appointment. If you do not specify the behavior manually, the SchedulerControl.AllowAppointmentDrag property manages whether end-users can drag appointments.

The SchedulerControl.CustomAllowAppointmentDragBetweenResources event fires when the end-user attempts to drag the appointment. Use this event to specify a particular case when the end-user can drag an appointment to another resource area. If you do not specify the behavior manually, the SchedulerControl.AllowAppointmentDragBetweenResources property manages whether end-users can drag appointments.

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