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

SchedulerView AppointmentSaving event goes infinite

6 Answers 81 Views
ScheduleView
This is a migrated thread and some comments may be shown as answers.
palak
Top achievements
Rank 1
palak asked on 09 Jun 2011, 08:52 AM
dear telerik team,

Here is a strange problem i am facing with appointmentsaving event of scheduleview. It loops infinite with the fact that i've not added any loop in my code. kindly see below code. Another fact is, below code perfectly works with RadScheduler Control, but not working with Radscheduleview.
private void SchedulerView_AppointmentSaving(object sender, AppointmentSavingEventArgs e)
       {
           busyIndicator.IsBusy = true;
           _ResourceAppointment = _Context.Web.Lists.GetByTitle("Events2011");
           _ResourceAppointmentList = new List<ResourceAppointment>();
           SP.ListItem listItem = _ResourceAppointment.AddItem(new ListItemCreationInformation());
           ResourceAppointment newAppointment = e.Appointment as ResourceAppointment;
           listItem["Title"] = newAppointment.Subject.ToString();
           listItem["EventDate"] = Convert.ToDateTime(newAppointment.Start).ToLocalTime();
           listItem["EndDate"] = Convert.ToDateTime(newAppointment.End).ToLocalTime();
           listItem["Description"] = newAppointment.Body.ToString();              listItem.Update();
           _ResourceAppointmentList.Add(newAppointment);
           SchedulerView.AppointmentsSource = _ResourceAppointmentList;
           _Context.Load(_ResourceAppointment, list => list.Title);
           _Context.ExecuteQueryAsync(OnSaveItemToListSucceeded, OnSaveItemToListFailed);
       }


kindly respond whats wrong with this.

thanks

6 Answers, 1 is accepted

Sort by
0
palak
Top achievements
Rank 1
answered on 09 Jun 2011, 02:46 PM
Guys,

Have you got anything regarding this issue ?

0
palak
Top achievements
Rank 1
answered on 10 Jun 2011, 06:03 AM
guys,

can u pls respond at least, whats wrong going with my code ?

this is the statement from where control bounces back to first statement of my appointmentsaving event, if i remove this, working fine. but i need to use this statement as i want to assign appointments list source to scheduleview appointment source to update it.

SchedulerView.AppointmentsSource = _ResourceAppointmentList;

kindly suggest, because my code is working perfectly with Scheduler control, but not with ScheduleView.

thanks & regards
0
Yana
Telerik team
answered on 13 Jun 2011, 12:05 PM
Hi Palak,

This is expected behavior - It is not recommended to change the AppointmentsSource of the ScheduleView in AppointmentSaving event handler. Please explain in more details your scenario so we to be able to provide a suitable solution.

Regards,
Yana
the Telerik team
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
0
palak
Top achievements
Rank 1
answered on 14 Jun 2011, 07:59 AM
due to urgency of solution, i managed it by alternate way. bt kindly check my another threads regarding conflicts between appointmentsaving event and appointmentedited event.

i am expecting bit answers to my threads bit as early as possible.

thank you for replying

regards
0
Satyendra
Top achievements
Rank 1
answered on 15 Jun 2011, 03:02 PM
I am running in same problem infinite loop occuring on AppointmentSaving event when trying to change AppointmentSource in AppointmentSaving event handler. If this is not recommended what is the right way to change AppointmentSource. After saving an appointment to database which event handler should be used to update source of ScheduleView?

Palak, How did you manage by alternate way?
0
palak
Top achievements
Rank 1
answered on 16 Jun 2011, 10:14 AM
satyendra,

i rebind the scheduler by calling my private method. you can call your method after any CRUD operations which specifically bind scheduler with the latest appointments as per your database.
 
But yes, i would say, appointmentsource property should not be set in any event of scheduler as per telerik.
Tags
ScheduleView
Asked by
palak
Top achievements
Rank 1
Answers by
palak
Top achievements
Rank 1
Yana
Telerik team
Satyendra
Top achievements
Rank 1
Share this question
or