$99 VS $1000+. UI Control for ASP.NET AJAX(contains chart and gridview).
Scheduler control for Windows Forms
Create rich Outlook style functionality and add rich scheduling interfaces to C# Windows application
Home > WinForms UI Controls > User Manual > Recurring Appointments in Scheduler in C#

C# Create Recurring Appointments with KetticScheduler

KetticScheduler control allows the developers to assign the recurrence rules to an appointment to build recurring appointment in C# Windows Forms application. This recurring appointment allows the recurrence based on minute, hour, day, week, month, and year. To build the recurrence for appointment, the Appointment C# class implements the IEvent interface, which contains the properties RecurrenceRule, MasterEvent, Occurrences and Exceptions. The Exceptions property of the interface allows the developers to create exceptional recurrence rule for the appointment.

Scheduler Recurrence Rule C# Class for Appointment

KetticScheduler control provides the RecurrenceRule C# class to build the recurrence rules for appointment. This RecurrenceRule C# class is the base class and contains different specialized classes to easily build the recurrence rules according to the relevant parameters. The specialized C# classes for recurring appointment include,
  • MinuteRecurrenceRule
  • HourRecurrenceRule
  • DayRecurrenceRule
  • WeekRecurrenceRule
  • MonthRecurrenceRule
  • YearRecurrenceRule
When the users need to customize the occurrence beyond the above rules, the IEvent interface of the appointment will create an exception and change the MasterEvent property to the original recurring appointment, which will be assigned to the Exceptions collection. As a result, the exception will contain no occurrence and be linked to the original recurrence.

Create Recurring for Appointments in C#

The RecurrenceRule C# classes allows the users to define the start time, duration and number of occurrences through the constructor overloads. After we define the recurrence rule, we can assign it to the RecurrenceRule property for the appointments. The simple C# code below demonstrates how to define a rule.

ketticScheduler1.Appointments[0].RecurrenceRule = new MinuteRecurrenceRule(DateTime.Now, 6, 12);
To iterate the occurrences of an appointment, we should use the Appointment Occurrences property. Moreover, when we need to get part of the entire occurrences between specific starting and stopping times, we shall implement the Appointment GetOccurrences() method. The C# code below demonstrates how to achieve this.

foreach (IEvent ev in recurringAppointment.Occurrences)
{
}
IEnumerable<IEvent> occurrencesAfter10AM = recurringAppointment.GetOccurrences(
new DateTime(2012, 10, 1, 10, 0, 0), DateTime.Now);

foreach (IEvent ev in occurrencesAfter10AM)
{
}
When the users need to beyond the series of the recurrence rules, they can create exceptions in C# projects and add the exceptions to the MasterEvent.Exceptions collection of the IEvent interface. The C# code below shows how to customize the background and status of an IEvent instance, and then add the IEvent to the collection.

myEvent.BackgroundId = (int)AppointmentBackground.Important;
myEvent.StatusId = (int)AppointmentStatus.Tentative;
myEvent.MasterEvent.Exceptions.Add(myEvent);
UI Controlsfor Windows Forms
.NET WinForms UI Overview.NET WinForms UI Features.NET WinForms UI GuideC# WinForms UI DesignVB.NET WinForms UI Design
WinForms UI Controls