DxSchedulerRecurrenceInfo Class
Contains recurrence information about an appointment.
Namespace: DevExpress.Blazor
Assembly: DevExpress.Blazor.v20.2.dll
NuGet Package: DevExpress.Blazor
Declaration
public class DxSchedulerRecurrenceInfo :
DxSchedulerSourceObjectContainer,
ISchedulerRecurrenceInfo,
INotifyPropertyChanged
Remarks
The DxSchedulerRecurrenceInfo class’ properties define the appointment’s recurrence rule.
When you bind the Scheduler to a collection of data objects, the appointment object should contain a field that specifies the recurrence rule. Use the DxSchedulerAppointmentMappings.RecurrenceInfo property to map this field to the appointment’s property in the Scheduler. The data source field’s value should be a string that starts with the RecurrenceInfo prefix and specifies options that correspond to the DxSchedulerRecurrenceInfo members. The following example demonstrates a sample field value in a correct notation.
<RecurrenceInfo Start="4/23/2020 7:00:00" End="9/23/2020 1:00:00" AllDay="False" DayNumber="1"
DayOfMonth="0" WeekDays="42" OccurenceCount="19" Frequency="1" Range="2" Type="1" />
Do the following to bind the Scheduler component to data:
- Create a DxSchedulerDataStorage object. Use the constructor without parameters.
- Use the DxSchedulerDataStorage.AppointmentsSource property to fill the storage with a collection of data objects.
- Create a DxSchedulerAppointmentMappings object and map data source fields to appointment properties.
- Assign the created object to the DxSchedulerDataStorage.AppointmentMappings property.
- Assign the data source to the Scheduler’s DataStorage property.
Follow the steps below to create a recurrence rule:
- Specify the Id property.
- Use the Type property to define the unit of time used to calculate appointment recurrences: Daily (0), Weekly (1), Monthly (2), or Yearly (3).
- Use the Start property to specify the recurrence range’s start date.
Define the recurrence range’s end date:
- To repeat the appointment until the specified date, set the Range property to EndByDate (2). Then, use the End property to define the end date.
- To repeat the appointment the specified number of times, set the Range property to OccurrenceCount (1). Then, use the OccurrenceCount property to define the number of occurrences.
- To repeat the appointment indefinitely, set the Range property to NoEndDate (0).
Specify the properties listed in the table below depending on the selected type.
Type | Properties |
---|---|
Daily (0) | One of the following properties: |
Weekly (1) | |
Monthly (2) |
|
Yearly (3) |
|
The following example demonstrates how to create four recurrent apppointments:
- Meeting on Daily Basis repeats every 3 days (15 times).
- Meeting on Weekly Basis repeats every 2 weeks on Thursday for 90 days.
- Meeting on Monthly Basis repeats on the 30th day of each month and has no end date.
- Meeting on Yearly Basis repeats on the last Monday in April every year and has no end date.
<DxScheduler StartDate="@DateTime.Today"
DataStorage="@DataStorage"
FirstDayOfWeek="System.DayOfWeek.Sunday">
<DxSchedulerWeekView VisibleTime="@VisibleTime"></DxSchedulerWeekView>
</DxScheduler>
@code {
DxSchedulerTimeSpanRange VisibleTime = new DxSchedulerTimeSpanRange(TimeSpan.FromHours(8),
TimeSpan.FromHours(19));
DxSchedulerDataStorage DataStorage = new DxSchedulerDataStorage() {
AppointmentsSource = RecurringAppointmentCollection.GetAppointments(),
AppointmentMappings = new DxSchedulerAppointmentMappings() {
Type = "AppointmentType",
Start = "StartDate",
End = "EndDate",
Subject = "Caption",
AllDay = "AllDay",
Location = "Location",
Description = "Description",
LabelId = "Label",
StatusId = "Status",
RecurrenceInfo = "Recurrence"
}
};
}