Refresh Schedule Control View after appointment addiction.
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
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
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
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
That was exactly what I was searching for!!
Regards
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
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
| this.scheduleControl1.GetScheduleHost().SetDataToDayPanels(); |
Thanks for your help
I have found the solution to my problem by the next line of code:
scheduleControl1.ResetProvider(ScheduleViewType.WorkWeek);
- 9 Replies
- 5 Participants
-
MM Mauro Moro
- Apr 21, 2015 08:56 AM UTC
- Aug 24, 2017 08:40 AM UTC