Skip to main content
A newer version of this page is available. .

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:

  1. Create a DxSchedulerDataStorage object. Use the constructor without parameters.
  2. Use the DxSchedulerDataStorage.AppointmentsSource property to fill the storage with a collection of data objects.
  3. Create a DxSchedulerAppointmentMappings object and map data source fields to appointment properties.
  4. Assign the created object to the DxSchedulerDataStorage.AppointmentMappings property.
  5. Assign the data source to the Scheduler’s DataStorage property.

Follow the steps below to create a recurrence rule:

  1. Specify the Id property.
  2. Use the Type property to define the unit of time used to calculate appointment recurrences: Daily (0), Weekly (1), Monthly (2), or Yearly (3).
  3. Use the Start property to specify the recurrence range’s start date.
  4. 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).
  5. Specify the properties listed in the table below depending on the selected type.

Type

Properties

Daily (0)

One of the following properties:

  • Frequency to repeat the appointment every N days.

  • WeekDays to repeat the appointment on the specified day or days.

Weekly (1)

  1. The Frequency property to define the appointment’s frequency (every N weeks).

  2. The WeekDays property to specify a day or days in the week.

Monthly (2)

  1. The Frequency property to define the appointment’s frequency (every N months).
  2. One of the following ways:
  • the DayNumber property to define the ordinal number of a day in the month.
  • the WeekOfMonth property to define the week in the month (first, second, etc.) and the WeekDays property to specify a day or days in the week.

Yearly (3)

  1. The Frequency property to define the appointment’s frequency (every N years).

  2. The Month property to specify the month in the year.

  3. One of the following ways:
  • the DayNumber property to define the ordinal number of a day in the month.
  • the WeekOfMonth property to define the week in the month (first, second, etc.) and the WeekDays property to specify a day or days in the week.

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"
        }
    };
}

Scheduler Recurring Appointments

Run Demo: Scheduler - Recurring Appointments

Inheritance

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