Back to Devexpress

DxScheduler.AppointmentDraggingBetweenResources Event

blazor-devexpress-dot-blazor-dot-dxscheduler-d8b6862d.md

latest3.2 KB
Original Source

DxScheduler.AppointmentDraggingBetweenResources Event

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

Namespace : DevExpress.Blazor

Assembly : DevExpress.Blazor.v25.2.dll

NuGet Package : DevExpress.Blazor

Declaration

csharp
[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:

PropertyDescription
AppointmentSpecifies the target appointment. Inherited from SchedulerAppointmentOperationEventArgs.
CancelGets or sets a value indicating whether the event should be canceled. Inherited from CancelEventArgs.
NewResourceIdSpecifies the identifier of a new resource associated with the appointment.
OldResourceIdSpecifies 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.

Note

If AppointmentDragMode is set to Client, the component does not raise the AppointmentDraggingBetweenResources event.

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

razor
<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

DxScheduler Class

DxScheduler Members

DevExpress.Blazor Namespace