SchedulerControl.DropAppointment Event
In This Article
Occurs when the user drops appointments within a Scheduler’s view.
Namespace: DevExpress.Xpf.Scheduling
Assembly: DevExpress.Xpf.Scheduling.v24.2.dll
NuGet Package: DevExpress.Wpf.Scheduling
#Declaration
#Event Data
The DropAppointment event's data class is DropAppointmentEventArgs. The following properties provide information specific to this event:
Property | Description |
---|---|
Allowed |
Returns a member of the Drag |
Cancel |
Gets or sets whether the event should be canceled.
Inherited from Cancel |
Conflicted |
Returns the collection of dragged appointments that are conflicting with the current appointments. |
Data | Allows you to generate an appointment when the user drags an object in the Scheduler from an external source. |
Drag |
Returns the list of dragged appointments. |
Effects |
Returns a member of the Drag |
Handled |
Gets or sets a value that indicates the present state of the event handling for a routed event as it travels the route.
Inherited from Routed |
Is |
Indicates whether the content was dragged from an external control or application. |
Key |
Gets a flag enumeration indicating the current state of the SHIFT, CTRL, and ALT keys, as well as the state of the mouse buttons. |
Original |
Gets the original reporting source as determined by pure hit testing, before any possible Source adjustment by a parent class.
Inherited from Routed |
Routed |
Gets or sets the Routed |
Source |
Gets or sets a reference to the object that raised the event.
Inherited from Routed |
Source |
Provides access to the collection of dragged appointments before the drag-drop operation. |
The event data class exposes the following methods:
Method | Description |
---|---|
Invoke |
When overridden in a derived class, provides a way to invoke event handlers in a type-specific way, which can increase efficiency over the base implementation.
Inherited from Routed |
On |
When overridden in a derived class, provides a notification callback entry point whenever the value of the Source property of an instance changes.
Inherited from Routed |
#Remarks
Set the event’s Cancel property to true to disable the default Scheduler’s drop behavior.
The example below illustrates how to override the AllowAppointmentConflicts property that is set to false.
private void Scheduler_DropAppointment(object sender, DropAppointmentEventArgs e) {
for (int i = 0; i < e.DragAppointments.Count; i++) {
//if a dragged appointment does not intersect another appointment
if (e.ConflictedAppointments[i].Count == 0) {
//it can be moved to the desired position
e.SourceAppointments[i].Start = e.DragAppointments[i].Start;
e.SourceAppointments[i].End = e.DragAppointments[i].End;
}
}
See Also