Skip to main content

DxSchedulerRecurrenceInfo Class

Contains recurrence information about an appointment.

Namespace: DevExpress.Blazor

Assembly: DevExpress.Blazor.v24.1.dll

NuGet Package: DevExpress.Blazor

Declaration

public class DxSchedulerRecurrenceInfo :
    DxSchedulerSourceObjectContainer,
    ISchedulerRecurrenceInfo,
    INotifyPropertyChanged

Remarks

The DxSchedulerRecurrenceInfo class properties define an appointment’s recurrence rule.

When you bind the Scheduler control to a collection of data objects, the recurrent appointment object should contain the following fields:

  • A field that sets the appointment’s type to 1 (corresponds to the Pattern value). Use the Type property to map this field to the appointment’s property.
  • A field that specifies the recurrence rule. Use the RecurrenceInfo property to map this field to the appointment’s property.

Recurrence Rule

A recurrence rule is 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 the correct notation.

"<RecurrenceInfo Id=\"15129fd3-9eb0-4861-8c43-c61844137f17\" Start=\"{0}\" Range=\"0\" 
                Type=\"3\" Frequency=\"1\" Month = \"4\" WeekOfMonth=\"5\" WeekDays=\"2\" />"

To create a recurrence rule, specify the following properties:

Id
Identifies the recurrence rule and allows the control to create a series based on the rule. Example: Id="bd5dc726-0fa6-4965"
Start
Specifies the recurrent appointment’s start date. Example: Start="04/01/2020 7:00:00"
Range
Determines how the series end date is specified: by the end date, number of occurrences, or no end date in the case of a recurrent appointment. The available values are listed below.
  • 0 - The recurrence range has no end date. Example: Range="0"
  • 1 - The range ends after its recurrence count exceeds OccurrenceCount. Example: Range="1" OccurrenceCount="15"
  • 2 - A recurrent appointment ends after the End date. Example: Range="2" End="05/01/2020 7:00:00"
Type

Specifies the unit of time used to calculate appointment reoccurrences: day, week, month, or year.

Daily (0)
Repeat the appointment every Frequency days.
Example: Type="0" Frequency ="3" - Repeats the appointment every 3 days.
Weekly (1)
Repeat the appointment every Frequency weeks on WeekDays days.
Example: Type="1" Frequency="2" WeekDays="16" - Repeats the appointment every 2 weeks on Thursdays.
Monthly (2)

Specify by a day number
Repeat the appointment every Frequency months on DayNumber days. Set the WeekOfMonth property to 0 to specify that the week in a month does not affect the recurrence rule.
Example: Type="2" Frequency="1" WeekOfMonth="0" DayNumber="30" - Repeats the appointment on the 30th day of every month.

Specify by a week day
Repeat the appointment every Frequency months in the WeekOfMonth week on WeekDays days.
Example: Type="2" Frequency="1" WeekOfMonth="1" WeekDays="2" - Repeats the appointment on the first Monday of every month.

Yearly (3)

Specify by a day number and a month
Repeat the appointment every Frequency years in the Month month on DayNumber days. Set the WeekOfMonth property to 0 to specify that the week in a month does not affect the recurrence rule.
Example: Type="3" Frequency="1" Month="3" WeekOfMonth="0" DayNumber="5" - Repeats the appointment on the 5th of March every year.

Specify by a week day and a month
Repeat the appointment every Frequency years in the Month month in the WeekOfMonth week on WeekDays days.
Example: Type="3" Frequency="1" Month="3" WeekOfMonth="1" WeekDays="2" - Repeats the appointment on the first Monday of March every year.

Index
Used for changed and deleted occurrences only. Specifies the appointment index in the recurring series, which should be the same as DxSchedulerAppointmentItem.RecurrenceIndex. Example: Index=\"25\"

The following example creates four recurrent appointments.

 <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",
            LabelId = "Label",
            RecurrenceInfo = "Recurrence"
        }
    };
}

Scheduler Recurring Appointments

Run Demo: Scheduler - Recurring Appointments

Recurrence Rule for Changed and Deleted Occurrences

For changed and deleted occurrences, a recurrence rule should contain Id and Index properties:

"<RecurrenceInfo Id=\"6de79b21-6b16-4dea-9736-c500058ec858\" Index=\"25\"/>"

Inheritance

Object
DevExpress.Blazor.Scheduler.Internal.NotifyPropertyChangedBase
DxSchedulerSourceObjectContainer
DxSchedulerRecurrenceInfo
See Also