Skip to main content

DevExpress v24.2 Update — Your Feedback Matters

Our What's New in v24.2 webpage includes product-specific surveys. Your response to our survey questions will help us measure product satisfaction for features released in this major update and help us refine our plans for our next major release.

Take the survey Not interested

ISchedulerRecurrenceInfo Interface

A base interface that defines recurrence information.

Namespace: DevExpress.Blazor

Assembly: DevExpress.Blazor.v24.2.dll

NuGet Package: DevExpress.Blazor

#Declaration

C#
public interface ISchedulerRecurrenceInfo :
    INotifyPropertyChanged

The following members return ISchedulerRecurrenceInfo objects:

#Remarks

The ISchedulerRecurrenceInfo interface is the base interface implemented in the DxSchedulerRecurrenceInfo class.

The following example prevents users from creating reccurent appointments that occur only once:

<DxScheduler @bind-StartDate="@StartDate"
             DataStorage="@DataStorage"
             AppointmentUpdating="AppointmentUpdating"
             AppointmentInserting="AppointmentInserting"
             AppointmentFormClosing="AppointmentFormClosing">
    <DxSchedulerWeekView ShowWorkTimeOnly="true"></DxSchedulerWeekView>
</DxScheduler>
<DxPopup @bind-Visible="@AlertVisible"
         CloseOnEscape="true"
         CloseOnOutsideClick="true"
         ShowCloseButton="true"
         HeaderText="Note"
         BodyText="The recurrent appointment occurs only once. Increase the appointment count or create a regular appointment.">
</DxPopup>

@code {
    bool AlertVisible = false;
    bool ValidationFailed = false;
    DateTime StartDate { get; set; } = DateTime.Today;

    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"
        }
    };
    bool IsAppointmentValid(DxSchedulerAppointmentItem appointment) {
        if (appointment.IsRecurring && 
                appointment.RecurrenceInfo.Range == SchedulerRecurrenceRange.OccurrenceCount &&
                appointment.RecurrenceInfo.OccurrenceCount == 1)
            return false;
        return true;
    }

    void AppointmentUpdating(SchedulerAppointmentOperationEventArgs e) {
        if (!IsAppointmentValid(e.Appointment)) {
            e.Cancel = true;
            AlertVisible = true;
            ValidationFailed = true;
        }
    }
    void AppointmentInserting(SchedulerAppointmentOperationEventArgs e) {
        if (!IsAppointmentValid(e.Appointment)) {
            e.Cancel = true;
            AlertVisible = true;
            ValidationFailed = true;
        }
    }
    void AppointmentFormClosing(SchedulerAppointmentFormClosingEventArgs e) {
        if (ValidationFailed) {
            e.Cancel = true;
            ValidationFailed = false;
        }
    }
}
See Also