How to: Customize an Appointment Recurrence Form
- 2 minutes to read
This document explains how to customize the dialog that allows users to modify recurrence settings.
Add and remove occurence pattern options
The default Appointment Recurrence form contains the “Daily”, “Weekly”, “Monthly” and “Yearly” pattern options.
The “Minutely” and “Hourly” patterns are hidden initially. Use the SchedulerOptionsCustomization.RecurrenceFormEditors property to choose which pattern options should be available to users.
schedulerControl1.OptionsCustomization.RecurrenceFormEditors =
RecurrenceFormEditors.Minutely | RecurrenceFormEditors.Hourly | RecurrenceFormEditors.Daily;
Custom recurrence form (versions 19.1 and older)
In v19.1 and older, you can create an AppointmentRecurrenceForm descendant and handle the SchedulerControl.EditAppointmentFormShowing event to replace a default form with this custom form.
void schedulerControl1_EditAppointmentFormShowing(object sender, DevExpress.XtraScheduler.AppointmentFormEventArgs e)
{
// The recurrence form allows you to edit only daily recurring appointments.
using(var myForm = new MyAppointmentEditForm(schedulerControl1,
e.Appointment, e.OpenRecurrenceForm, DevExpress.XtraScheduler.RecurrenceType.Daily))
myForm.ShowDialog();
e.Handled = true;
}
See this GitHub example for a complete sample.
Custom recurrence form (versions 19.2 and newer)
In v19.1 and older, Appointment Recurrence Form editors were placed directly on the form’s surface. Starting with v19.2, the form uses the LayoutControl to arrange its editors. The Layout Control ensures that the form has a correct layout when shown on HiDPI devices.
Due to this change, you cannot create custom AppointmentRecurrenceForm
descendants and use them in v19.2 and newer. If you upgrade to v19.2 and want to use your custom forms, change your custom forms’ base class from AppointmentRecurrenceForm
to LegacyAppointmentRecurrenceForm
.