Skip to main content

DxScheduler.AppointmentInserted Event

Fires after a new appointment is added to the AppointmentsSource object.

Namespace: DevExpress.Blazor

Assembly: DevExpress.Blazor.v22.2.dll

NuGet Package: DevExpress.Blazor


public EventCallback<DxSchedulerAppointmentItem> AppointmentInserted { get; set; }


Type Description

A DxSchedulerAppointmentItem object that stores an added appointment.


Use the AppointmentInserted event to access an added appointment after it has been saved to the AppointmentsSource object.


To cancel an appointment insertion or to modify an inserted appointment before it is saved, use the AppointmentInserting event.

The code below uses the AppointmentInserting event to change the added appointment’s Id property, and then detects this property’s value to access the appointment after it has been added to the AppointmentsSource object.

<DxScheduler DataStorage="..."
             AppointmentInserting="(e) => AppointmentInserting(e)"
             AppointmentInserted="async (e) => await AppointmentInserted(e)">
    <DxSchedulerDayView ShowWorkTimeOnly="true"></DxSchedulerDayView>

@code {

    void AppointmentInserting(SchedulerAppointmentOperationEventArgs e) {
        e.Appointment.Id = -1;

    async Task AppointmentInserted(DxSchedulerAppointmentItem e) {
        MedicalAppointments insertedItem = (DataStorage.AppointmentsSource as List<MedicalAppointments>).Where(m => m.Id == -1).FirstOrDefault();
        insertedItem.Id = 0;
        await Http.PostJsonAsync<MedicalAppointments>("", insertedItem);

View Example: Scheduler for Blazor - How to implement CRUD operations with a Web API Service

See Also