How to: Set End-User Restrictions
- 2 minutes to read
In some real-life applications, it might be necessary to prevent end-users from creating or editing (copy, deleting, dragging, etc.) appointments shown within the SchedulerControl. For instance, it may be necessary to show all appointments to end-users as read-only.
To implement end-user restrictions in your application, you can use the SchedulerControl.OptionsCustomization property, which provides access to the customization settings. The following restrictions are possible in the SchedulerControl.
Restriction | Description |
---|---|
Options |
Gets or sets a value that specifies whether an end-user is allowed to share the schedule time between two or more appointments. |
Options |
Gets or sets a value that specifies whether an end-user is allowed to copy appointments. |
Options |
Gets or sets a value that specifies whether an end-user is allowed to create new appointments. |
Options |
Gets or sets a value that specifies whether an end-user is allowed to delete appointments. |
Options |
Gets or sets a value that specifies whether an end-user is allowed to drag and drop appointments to another time slot or date. |
Options |
Gets or sets a value that specifies whether an end-user is allowed to drag and drop appointments between resources. |
Options |
Gets or sets a value that specifies whether an end-user is allowed to edit appointments. |
Options |
Gets or sets a value that specifies whether an end-user is allowed to select more than one appointment simultaneously. |
Options |
Gets or set a value that specifies whether an end-user is allowed to change the time boundaries of appointments. |
Options |
Gets or sets the option specifying whether the Edit Appointment form can be invoked. |
Options |
Gets or sets a value that specifies whether an inplace editor can be activated for an appointment. |
You can set a corresponding value as required, e.g., set UsedAppointmentType.None to prohibit a particular action for all appointment types, or set it to UsedAppointmentType.Recurring to allow it for recurring appointments only.
If you set one of the OptionsCustomization.Allow* properties to UsedAppointmentType.Custom, a related Allow* event will fire; you can decide how to handle any particular case in this event.
This example demonstrates how to prevent end-users from creating appointments within a certain time interval (from 2 PM to 3 PM). To implement end-user restrictions, handle the SchedulerControl.AllowAppointmentCreate event to prevent end-users from creating appointments within a certain time interval and the SchedulerControl.AllowAppointmentConflicts event to prevent an existing appointment from being dragged to the same time interval: