Skip to main content
A newer version of this page is available. .

DxScheduler.AppointmentInserted Event

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

Namespace: DevExpress.Blazor

Assembly: DevExpress.Blazor.v23.1.dll

NuGet Package: DevExpress.Blazor

Declaration

[Parameter]
public EventCallback<DxSchedulerAppointmentItem> AppointmentInserted { get; set; }

Parameters

Type Description
DxSchedulerAppointmentItem

A DxSchedulerAppointmentItem object that stores an added appointment.

Remarks

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

Note

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

<DxScheduler DataStorage="..."
             AppointmentInserted="@AppointmentInserted">
    <DxSchedulerDayView ShowWorkTimeOnly="true"></DxSchedulerDayView>
</DxScheduler>


@code {
    ...

    async Task AppointmentInserted(DxSchedulerAppointmentItem e) {
        MedicalAppointments insertedItem = e.SourceObject as MedicalAppointments;
        HttpResponseMessage response = await PostItemAsync(insertedItem);
        using var responseStream = await response.Content.ReadAsStreamAsync();
        MedicalAppointments newItem = await JsonSerializer.DeserializeAsync<MedicalAppointments>(responseStream);
        insertedItem.id = newItem.id;
        startDate = newItem.startTime;
        DataStorage.RefreshData();
        StateHasChanged();
    }
}    

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

See Also