Schedule control + CalDav server

Hi all,
i'd like to load and manage events on a caldav server with schedule control, is it possible? Is there any tutorial or snippet of code?
Let me know,
thank you Alessandro

3 Replies

SN Sindhu Nagarajan Syncfusion Team March 13, 2018 05:35 PM UTC

Hi Alessandro, 
 
Thanks for contacting Syncfusion support. 
 
By default, ScheduleControl does not have the support to auto update the binding object. So, we are unable to configure to update the changes directly in any db server. So, you can manually update the schedule control appointment changes by using ItemChanged event. By this event, you can get the modified items then it can be update in your server. Please refer to the below code example,  
 
Code Example 
 
this.scheduleControl1.ItemChanged += ScheduleControl1_ItemChanged; 
 
private void ScheduleControl1_ItemChanged(object sender, ScheduleAppointmentEventArgs e) 
{ 
    IScheduleAppointment item = null; 
    switch (e.Action) 
    { 
        case ItemAction.Add: 
        case ItemAction.Delete: 
        case ItemAction.Edit: 
        case ItemAction.ItemDrag: 
            item = e.CurrentItem; 
            break; 
    } 
 
    if (item == null) 
        return; 
 
    DateTime startTime = item.StartTime; 
    DateTime endTime = item.EndTime;  
 
    //Here you can get the modified item values, and you can update this item in your server. 
} 
  
 
Please let us know if you have any other queries. 
 
Regards, 
Sindhu  



AT Alessandro Turella March 15, 2018 04:58 PM UTC

Thank you Shindu,

this is ok for update and synchronize to server after some change, isn't it?
what about getting and serialize from a caldav calendar on the web?
Thank you for your time,
Alessandro


SN Sindhu Nagarajan Syncfusion Team March 16, 2018 12:54 PM UTC

Hi Alessandro, 
 
Thanks for the update. 
 
By default, ScheduleControl does not have support for serialization/deserialization. So, you need to manually get the details from serialized file and create the appointment for schedule control using below code, 
 
Code Example 
public class Form1 : Form 
{ 
    SimpleScheduleDataProvider scheduleProvider = new SimpleScheduleDataProvider(); 
    IScheduleAppointment item = dataProvider.NewScheduleAppointment(); 
    item = dataProvider.NewScheduleAppointment();     
    item.StartTime = new System.DateTime(2018, 05, 21);     
    item.EndTime = DateTime.Now.AddMinutes(30); 
    item.AllDay = true; 
    item.Subject = "Business";  
    item.LabelValue = 1; 
    dataProvider.AddItem(item); 
    this.scheduleControl1.ResetProvider(this.scheduleControl1.ScheduleType); 
} 
 
 
Note: 
If the ArrayListDataProvider has binded with ScheduleControl,  you can use of the below KB link to create the new appointment, 
 
Please let us know if you have any other queries. 
 
Regards, 
Sindhu  


Loader.
Up arrow icon