Add Recurring Appointment

How do I add a recurring appointment on the schedule control programatically?
I am able to add non recurring appointments on the control but I can't seem to add a recurring one.

Thanks in advance !



2 Replies

MI mike October 27, 2016 08:15 AM UTC

By the way I'm using C#


AK Adhikesevan Kothandaraman Syncfusion Team October 28, 2016 02:44 PM UTC

Hi Mike,  

Thanks for using Syncfusion product. 

To add the multi span day appointment in a schedule control, you can use the AddSpanAppointment method. Please refer to the following code snippet to add the multi span day appointment in schedule control,  
 
Code Snippet:  
ArrayListDataProvider dataprovider = new Syncfusion.Schedule.ArrayListDataProvider();  
IScheduleAppointment appointment = dataprovider.NewScheduleAppointment();        
  
appointment = dataprovider.NewScheduleAppointment();  
appointment.StartTime = DateTime.Now;  
appointment.EndTime = DateTime.Now.AddDays(4);  
appointment.AllDay = true;  
appointment.Subject = "Leave";  
appointment.LabelValue = 1;  
appointment.AllowResize = false;  
appointment.AllowDrag = false;  
  
//Convert the appointment as the recurrence schedule appointment   
IRecurringScheduleAppointment recurrenceAppointment = appointment as IRecurringScheduleAppointment;       
//Add the multi-span day appointment to the schedule control  
this.scheduleControl1.AddSpanAppointment(recurrenceAppointment, dataprovider);  
this.scheduleControl1.DataSource = dataprovider;  

Sample: 

Regards, 
Adhi 
 


Loader.
Up arrow icon