DxSchedulerAppointmentItem Class
The scheduled event displayed in the Scheduler’s view.
Namespace: DevExpress.Blazor
Assembly: DevExpress.Blazor.v21.2.dll
NuGet Package: DevExpress.Blazor
Declaration
public class DxSchedulerAppointmentItem :
DxSchedulerSourceObjectContainer
Related API Members
The following members return DxSchedulerAppointmentItem objects:
Remarks
Appointments are stored in the DxSchedulerDataStorage object. They are automatically created from source objects retrieved from the AppointmentsSource collection. When a user modifies an appointment, the related source object is updated automatically. When users add or delete appointments, the storage’s appointment collection changes and the collection of source objects reflects the changes.
Create Appointment
Click an empty cell in the view and drag the mouse pointer across other cells to extend the selection.
Release the button. The compact edit form appears.
Fill in the fields and click Save or click the Expand Arrows button to show the pop-up (detailed) form:
Fill in the fields and click Save.
You can prevent users from creating new appointments. To do this, set the AllowCreateAppointment property to false
.
Edit Appointment
Users can change an appointment as follows:
- Reschedule: drag and drop an appointment to another cell.
- Extend or shorten: drag the top or bottom appointment’s border.
- Change the appointment details.
To change the appointment details, do the following:
Click an appointment to show its tooltip:
Click the Edit button to invoke the compact edit form.
Edit the fields and click Save.
You can also use the pop-up (detailed) form to edit the appointment fields. To show the form, click the Expand Arrows button .
You can prevent users from editing appointments. To do this, set the AllowEditAppointment property to false
.
Delete Appointment
Click an appointment to show its tooltip.
Click the Delete button .
Tip
If an appointment is a regular occurrence in a recurring series, a confirmation dialog appears as described in the Delete Recurring Appointment or Series
section.
You can prevent users from deleting appointments. To do this, set the AllowDeleteAppointment property to false
.
Appointment Types
One-Time Appointment
A one-time appointment has its start and end, and does not belong to any recurring series. The DxSchedulerAppointmentItem.Type is OneTime.
A source object for the one-time appointment has the following properties:
@code {
Appointment apt = new Appointment {
AppointmentId = 1,
Caption = "Website Redesign Plan",
StartDate = DateTime.Today.Date + (new TimeSpan(1, 9, 30, 0)),
EndDate = DateTime.Today.Date + (new TimeSpan(1, 11, 30, 0))
};
}
All-Day Appointment
An all-day appointment is a one-time appointment that occupies the entire day or multiple days. Its Type is OneTime and the AllDay property is true.
All-day appointments are displayed in the all-day panel at the top of the view:
A user can turn on the All Day switch in the Appointment form to convert a one-time appointment to an all-day appointment.
An all-day appointment’s source object has the following properties:
@code {
Appointment apt = new Appointment {
AppointmentId = 2,
Caption = "Book Flights to San Fran for Sales Trip",
StartDate = date + (new TimeSpan(1, 12, 0, 0)),
EndDate = date + (new TimeSpan(1, 13, 0, 0)),
AllDay = true
};
}
You can convert a one-time appointment to an all-day appointment. To do this, set the AllDay property to true. The Start and End property values still remain, but they are ignored. Only the Start property is used to determine the day the all-day appointment occupies.
Recurring Appointments
A recurring appointment is an appointment that repeats on a schedule. A recurring appointment in a scheduler view is indicated with a recurrence icon .
A recurring series consists of appointments that have the same recurrence pattern.
A recurrence pattern’s source object has the following properties:
@code {
RecurringAppointment apt = new RecurringAppointment {
AppointmentId = 4,
AppointmentType = 1,
Caption = "Daily Meeting",
StartDate = date + (new TimeSpan(1, 9, 0, 0)),
EndDate = date + (new TimeSpan(1, 9, 15, 0)),
Recurrence = string.Format("<RecurrenceInfo Start=\"{0}\" End=\"{1\"
WeekDays=\"62\" Id=\"6de79b21-6b16-4dea-9736-c500058ec858\"
OccurrenceCount=\"25\" Range=\"1\" />",
date + (new TimeSpan(1, 9, 0, 0)), date + (new TimeSpan(1, 9, 15, 0)))
};
}
A recurrence rule specifies a recurring series’s schedule. The RecurrenceInfo property contains the rule and the RecurrenceInfoId property contains the rule ID. The pattern is created from appointment item data retrieved from the scheduler storage. Other appointments in a series are created from the pattern and their Start and End values are calculated based on a recurrence rule.
When you delete or change a recurring appointment, an exception appointment is created (the Type is set to DeletedOccurrence or ChangedOccurrence ). The exception contains the identifier of its recurrence info and recurrence index that prevents the scheduler from creating a recurring appointment in place of an exception.
Create Recurring Series
Select a value other than Never in the Appointment form’s Repeat section to create a recurring appointment series from a one-time or all-day appointment:
The Recurrence Rule form appears. For each rule type it has a different layout, as illustrated in the image gallery below:
Fill in the fields to specify the recurrence rule and click Save to assign it to the RecurrenceInfo property.
Edit Recurring Series
To edit a recurring appointment, click it to show its tooltip and click the Edit button. The following dialog appears:
- Click Edit series to invoke the Appointment form that allows you to modify the recurrence pattern and recurrence rule. Click Save to save changes to the pattern.
- Click Edit appointment to invoke the Appointment form without the Repeat section. It prevents you from changing the recurrence rule. Click Save to create a new appointment that is the recurrence exception.
Delete Recurring Appointment or Series
Click the recurring appointment to show the appointment tooltip and click the Delete button. The following dialog appears:
- Click Delete series to delete the recurrence pattern and all appointments that belong to a series, including exceptions.
- Click Delete appointment to remove the regular appointment occurrence and create a new hidden appointment that is the recurrence exception and has the DeletedOccurrence type.
Restore Occurrence
You can convert the recurrence exception back to the regular occurrence. For this, click the appointment that is the recurrence exception to show the appointment tooltip and click the Restore Occurrence button .