SchedulerControl.StartAppointmentDragFromOutside Event
Occurs when the user drags an object in the Scheduler from an external source.
Namespace: DevExpress.Xpf.Scheduling
Assembly: DevExpress.Xpf.Scheduling.v24.1.dll
NuGet Package: DevExpress.Wpf.Scheduling
Declaration
Event Data
The StartAppointmentDragFromOutside event's data class is DevExpress.Xpf.Scheduling.StartAppointmentDragFromOutsideEventArgs.
Remarks
The CompleteAppointmentDragDrop event does not fire if the drag-drop operation has been initialized outside the Scheduler.
The example below illustrates how to implement drag-drop from a text editor and GridControl.
private void Scheduler_StartAppointmentDragFromOutside(object sender,
StartAppointmentDragFromOutsideEventArgs e) {
// if the user is dragging GridControl data
if (e.Data.GetDataPresent(typeof(RecordDragDropData))) {
var rddData = (RecordDragDropData) e.Data.GetData(typeof(RecordDragDropData));
foreach (var appData in rddData.Records.Cast<AppointmentData>()) {
var appointment = new AppointmentItem {
Subject = appData.Subject,
Location = appData.Location
};
appointment.End = appointment.Start + appData.Length;
e.DragAppointments.Add(appointment);
}
}
// if the user is dragging text
if (e.Data.GetDataPresent(typeof(string))) {
var subject = (string) e.Data.GetData(typeof(string));
var appointment = new AppointmentItem { Subject = subject };
e.DragAppointments.Add(appointment);
}
}
Related GitHub Examples
The following code snippet (auto-collected from DevExpress Examples) contains a reference to the StartAppointmentDragFromOutside event.
Note
The algorithm used to collect these code examples remains a work in progress. Accordingly, the links and snippets below may produce inaccurate results. If you encounter an issue with code examples below, please use the feedback form on this page to report the issue.