Skip to main content
A newer version of this page is available. .
All docs
V23.1

DxScheduler.AppointmentDraggingBetweenResources Event

Fires after a user drags an appointment to another resource group.

Namespace: DevExpress.Blazor

Assembly: DevExpress.Blazor.v23.1.dll

NuGet Package: DevExpress.Blazor

Declaration

[Parameter]
public EventCallback<SchedulerAppointmentDragBetweenResourcesEventArgs> AppointmentDraggingBetweenResources { get; set; }

Event Data

The AppointmentDraggingBetweenResources event's data class is SchedulerAppointmentDragBetweenResourcesEventArgs. The following properties provide information specific to this event:

Property Description
Appointment Specifies the target appointment. Inherited from SchedulerAppointmentOperationEventArgs.
Cancel Gets or sets a value indicating whether the event should be canceled. Inherited from CancelEventArgs.
NewResourceId Specifies the identifier of a new resource associated with the appointment.
OldResourceId Specifies the identifier of the resource associated with the appointment.

Remarks

This event is raised after a user drags an appointment to another resource group. Use the event argument object (SchedulerAppointmentDragBetweenResourcesEventArgs) to identify target and source resources. Obtain values from NewResourceId and OldResourceId properties.

You can set the event argument’s Cancel property to true to prevent users from dragging appointments between resource groups.

<DxScheduler StartDate="@DateTime.Today"
             DataStorage="@DataStorage"
             AppointmentDraggingBetweenResources="OnDragging"
    ...
</DxScheduler>

@Alert

@code {
    ...

    string Alert;

    void OnDragging(SchedulerAppointmentDragBetweenResourcesEventArgs args) {
        if (args.NewResourceId as int? == 1) {
            args.Cancel = true;
            Alert = "You cannot drag this appointment to another resource.";
        }
    }
}
See Also