Skip to main content

DevExpress v24.2 Update — Your Feedback Matters

Our What's New in v24.2 webpage includes product-specific surveys. Your response to our survey questions will help us measure product satisfaction for features released in this major update and help us refine our plans for our next major release.

Take the survey Not interested

DxScheduler.AppointmentDraggingBetweenResources Event

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

Namespace: DevExpress.Blazor

Assembly: DevExpress.Blazor.v24.2.dll

NuGet Package: DevExpress.Blazor

#Declaration

C#
[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