We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy.
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

How to clear appointments on Schedule

Thread ID:

Created:

Updated:

Platform:

Replies:

132531 Sep 6,2017 11:46 PM UTC Sep 7,2017 01:04 PM UTC WinForms 1
loading
Tags: ScheduleControl
darik
Asked On September 6, 2017 11:46 PM UTC

Hi Everywhere! I would like to know how to clear the list of events from scheduleControl, because when I click on another day of the month the events will accumulate and be repeated, for example, when I have a day 10 event, every time I click on another day the event of day 10 new is added in the Schedule, creating a retry.
Thanks in Advance!

Mohanraj Gunasekaran [Syncfusion]
Replied On September 7, 2017 01:04 PM UTC

  
Hi Ary, 

Thanks for using Syncfusion product. 

By default, events are scheduled based on DateTime. We are little bit unclear about your scenario. In your scenario events(appointments) are repeated when move to next day. So, can you please confirm whether you are binding number of events in a display date alone or binding more events for more days. It can be checked by using the below code, 

Code example 
//To get the list of event in specified date. 
var events = (this.scheduleControl1.DataSource as SimpleScheduleDataProvider).GetSchedule(DateTime.Now, DateTime.Now); 
 

If you want to clear the appointments, you can use the Remove or RemoveAt method using MasterList property. Please refer to the below code example,  
Code example 
var masterlist = (this.scheduleControl1.DataSource as SimpleScheduleDataProvider).MasterList; 
//To get the list of event in specified date. 
var events = (this.scheduleControl1.DataSource as SimpleScheduleDataProvider).GetSchedule(DateTime.Now, DateTime.Now); 
 
foreach (IScheduleAppointment item in events) 
{ 
    masterlist.Remove(item); 
} 
//To update the scheduleControl. 
this.scheduleControl1.ResetProvider(this.scheduleControl1.ScheduleType); 

 

If it is possible, please provide the sample or modify the below attached sample to reproduce your scenario. It will be helpful to provide the solution at the earliest. 

Sample link: ScheduleControl 

Regards, 
Mohanraj G         
 


CONFIRMATION

This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

Warning Icon You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.Close Icon

;