SchedulerAppointmentOperationEventArgs Class
Provides data for the AppointmentInserting, AppointmentUpdating, and AppointmentRemoving events.
Namespace: DevExpress.Blazor
Assembly: DevExpress.Blazor.v21.1.dll
NuGet Package: DevExpress.Blazor
Declaration
public class SchedulerAppointmentOperationEventArgs :
EventArgs
Remarks
The SchedulerAppointmentOperationEventArgs class includes the following properties:
- Appointment - Specifies an appointment that is modified (added, updated or removed).
- Cancel - Specifies whether the corresponding appointment operation (addition, update or removal) should be canceled.
The code below uses the Cancel property to restrict non-Admin users to add appointments to the DxScheduler.
<DxScheduler StartDate="@(new DateTime(2018, 10, 10))"
DataStorage="@DataStorage"
AppointmentInserting="(e) => AppointmentInserting(e)">
</DxScheduler>
@if (PopupVisible) {
<DxPopup HeaderText="Warning" CloseButtonClick="@(() => PopupVisible = false)">
<p>You are not allowed to add new appointments to the scheduler. Please contact your system administrator for details.</p>
</DxPopup>
}
@code {
bool popupVisible = false;
bool PopupVisible { get => popupVisible; set { popupVisible = value; InvokeAsync(StateHasChanged); } }
void AppointmentInserting(SchedulerAppointmentOperationEventArgs e) {
if (currentUser.Role != "Admin") {
e.Cancel = true;
PopupVisible = true;
}
}
}
See Also