This is a migrated thread and some comments may be shown as answers.

Server Side Code Issue With RadScheduler

2 Answers 17 Views
Scheduler
This is a migrated thread and some comments may be shown as answers.
Brett
Top achievements
Rank 1
Brett asked on 09 Sep 2013, 04:59 PM
I have no problem populating data into my RadScheduler control.  However, I do have a problem with the way it keeps repeating everytime I refresh the page.  Here is my code when adding to the RadScheduler.  Why is it everytime I refresh the page or go to another view, it adds another record of the appointment or event?  Thank you!

for (int i = 0; i < evearray.Length; i++)
               {
                   Appointment apt = new Appointment(evearray[i].EventId, evearray[i].EventStartDateTime, evearray[i].EventEndDateTime, evearray[i].EventName);
 
                   date[i] = new Telerik.Web.UI.RadDate(evearray[i].EventStartDateTime);
                    
                   RadScheduler1.InsertAppointment(apt);                                                          
 
               }

2 Answers, 1 is accepted

Sort by
0
Boyan Dimitrov
Telerik team
answered on 12 Sep 2013, 10:12 AM
Hello,

I would like to clarify when navigating between RadScheduler views a post-back to the server is initiated. So basically if you add appointments to the RadScheduler in Page_Load  event handler it will add those appointments each time when post-back is initiated (navigating between views) unless you use a different approach for populating appointments. I would suggest reviewing our RadScheduler online demo showing how you can store the appointments in the session variable and use it as RadScheduler data source. That way you can avoid duplicating appointments while navigating between the views and keep the ability to create, update and delete appointments.

Hope that this will be helpful.

Regards,
Boyan Dimitrov
Telerik
If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to the blog feed now.
0
Brett
Top achievements
Rank 1
answered on 12 Sep 2013, 11:30 AM
Thank you Boyan. I initialized the population of the scheduler by adding the records to the session. That in turn eliminates duplicate records with the scheduler
Tags
Scheduler
Asked by
Brett
Top achievements
Rank 1
Answers by
Boyan Dimitrov
Telerik team
Brett
Top achievements
Rank 1
Share this question
or