WeeklyRecurrenceControl Class
The control used to set recurrence options for weekly recurring appointments.
Namespace: DevExpress.XtraScheduler.UI
Assembly: DevExpress.XtraScheduler.v18.1.dll
Declaration
[ToolboxTabName("DX.18.1: Scheduling")]
[ToolboxBitmap(typeof(SchedulerControl), "Bitmaps256.weeklyRecurrenceControl.bmp")]
[ComVisible(false)]
public class WeeklyRecurrenceControl :
RecurrenceControlBase
Remarks
The control enables you to specify the RecurrenceInfo.Periodicity and the RecurrenceInfo.WeekDays values for the recurrence of the RecurrenceType.Weekly type.
Use the RecurrenceControlBase.RecurrenceInfo property to specify the recurrence settings, and the WeeklyRecurrenceControl.FirstDayOfWeek to set the day selected as the first day of the week. The RecurrenceControlBase.UpdateControls method forces the control to display its current settings.
When a user performs a selection, the RecurrenceInfo object of the control is changed and the RecurrenceControlBase.RecurrenceInfoChanged event is fired.
The common appearance of the WeeklyRecurrenceControl is shown in the picture below.
Example
The code below is an example of the custom recurrent appointment editing form. Invoke it for recurring appointments. This form allows changing recurrence options only. To change start/end times and durations, add other controls to the form.
Handle the SchedulerControl.EditAppointmentFormShowing event to invoke a custom form instead of the default AppointmentForm.
Note
A complete sample project is available at https://github.com/DevExpress-Examples/how-to-create-a-simple-recurrence-form-t222451
- Program.cs
- MyAppointmentRecurrenceForm.cs
- Form1.cs
- MyAppointmentRecurrenceForm.vb
- Form1.vb
- Program.vb
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using System.Windows.Forms;
namespace CustomRecurrenceFormWinFormSample
{
static class Program
{
/// <summary>
/// The main entry point for the application.
/// </summary>
[STAThread]
static void Main()
{
Application.EnableVisualStyles();
Application.SetCompatibleTextRenderingDefault(false);
Application.Run(new Form1());
}
}
}