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. Image for the cookie policy date

Refresh Schedule Control View after appointment addiction.

Hi there,
my name's Mauro and I'm a new user of Syncfusion suite. I'm sure you have answered, in a way or another, to this question but I didn't find what I'm looking for.
The question is:
I add a new appointment every x minutes to a schedule control, reading the parameters from emails (I have just implemented the parsing mode to suite my needs) and creating a new SimpleScheduleAppointment object.
But after this addiction I cannot refresh the schedule view and cannot see the new appointments without close and reopen the form.

Thx in advance.

Mauro


9 Replies

AG Anish George Syncfusion Team April 23, 2015 05:01 AM UTC

Hi Mauro,

Thank you for your interest in Syncfusion products.

We suggest you to use the Refresh method for reloading the schedule grid. Please refer the below code snippet.

C#:

this.scheduleControl1.Refresh();

We also suggest you to look into our UG and KB articles for more information related to our Schedule Control.

UG:
https://help.syncfusion.com/windowsforms/overview

KB:
https://www.syncfusion.com/forums/windowsforms

Please let us know if you need any further assistance.

Regards,
Anish



MM Mauro Moro April 23, 2015 07:41 AM UTC

Hi Anish and thx for your help.
I explain what I need to do: every x minutes I want to check an email box and if there is a new email, I'm going to import it and, after a parsing method, i want to insert the result as property of appointment object.
The fact is I don't pass throught an appointment form and it's methods.
I can save the appointment but after a appointment addiction I need to exit the program and reload the source to see the result.

Could you pls show me where to put the Refresh() method, I mean in which schedule control event should I put the refresh method??

Regards
Mauro



AG Anish George Syncfusion Team April 24, 2015 10:25 AM UTC

Hi Mauro,

Thank you for your update.

We would like to let you know that there is no particular event to get fired whenever you change the datasource in the backend. Because, the schedule control will not recognize the changes that are made in the backed datasource unless and until it is reinitialized. We suggest you to manually assign the datasource in a button click event or timer event. We suggest you to use the timer event in such a way that it gets fired in a particular time interval. Along with the refresh method, you also need to assign the datasource again for the particular schedule control which you are using. Please refer the following code example :

C#:

Timer timer = new Timer();

timer.Interval = 300000;

timer.Tick += new EventHandler(timer_Tick);

void timer_Tick(object sender, EventArgs e)

{

this.scheduleControl1.DataSource = datasource; // re-assign the datasource.

this.scheduleControl1.Refresh();

}

Please let us know if you need any further assistance.

Regards,
Anish



MM Mauro Moro April 24, 2015 02:01 PM UTC

Thank you very much.
That was exactly what I was searching for!!

Regards
Mauro


SC Saranya CJ Syncfusion Team April 27, 2015 11:02 AM UTC

Hi Mauro,

Thank you for your update. We are glad to know that your reported issue have been resolved. Please let us know if you require any other assistance on this.

Regards,
Saranya


RA Raul August 22, 2017 04:01 PM UTC

Hi.

In my project, I have added a new appointment and save it in database in scheduleControl_ScheduleAppointmentClick event. In the same event, in last line of code, I have wrote :

scheduleControl.Refresh() 

that should reload all my appointment data but nothing occurs.

Can someone help me?

Thanks in advance

Raul



MG Mohanraj Gunasekaran Syncfusion Team August 23, 2017 12:14 PM UTC

Hi Raul,  
 
Thanks for using Syncfusion product.  
 
In order to reload your all appointment, SetDataToDayPanels can be used. Please refer to the below code example,  
 
Code example  
this.scheduleControl1.GetScheduleHost().SetDataToDayPanels();  
  
Sample link: ScheduleControl  
  
Note: If you want to use the GetScheduleHost().SetDataToDayPanels method, you should add the Syncfusion.Grid.Windows dll in your project reference. Please refer the below screenshot,  
  
Screenshot  
  
  
Regards,  
Mohanraj G  
 



RA Raul August 23, 2017 12:49 PM UTC

Thanks for your help

I have found the solution to my problem by the next line of code:

scheduleControl1.ResetProvider(ScheduleViewType.WorkWeek);






MG Mohanraj Gunasekaran Syncfusion Team August 24, 2017 08:40 AM UTC

Hi Raul,  
 
Thanks for your update. 
 
Yes, you can also use the ResetProvider method to update schedule control appointments. Anyway, we are glad to know that your reported problem has resolved. 
 
Please let us know, if you have any concerns. 
 
Regards, 
Mohanraj G 


Loader.
Up arrow icon