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

[Solved] Edited appointment not updating

3 Answers 150 Views
Scheduler
This is a migrated thread and some comments may be shown as answers.
Jeremy Hoehn
Top achievements
Rank 1
Jeremy Hoehn asked on 18 Dec 2009, 07:36 PM
I am using the scheduler control with mostly the default settings.  I am databinding my own datasource in code, and have created event handlers for the AppointmentInsert and AppointmentDelete events, which work just fine.  My AppointmentUpdate event seems to have a small problem.  I'm sure it's something simple, but I can't seem to figure out what.

The problem is that the event fires and I'm able to update the appointment record in my database just fine.  But the scheduler control does not retain the updated information.  It continues to display the previous information.  It's as though it's canceling the update event.

Here is my code:

       protected void rscSchedule_AppointmentUpdate(object sender, AppointmentUpdateEventArgs e) 
        { 
            aspnet_User user = SecurityExtended.UserGet(Page.User.Identity.Name); 
            Telerik.Web.UI.Appointment appointment = e.ModifiedAppointment; 
            Data.Appointment appt = Appointments.AppointmentUpdate((int)appointment.ID, appointment.Subject, appointment.Start, appointment.End, user.UserId, appointment.RecurrenceRule, (int?)appointment.RecurrenceParentID, "", appointment.Description, true); 
 
            foreach (Resource resource in appointment.Resources) 
            { 
                AppointmentResourceType rt = Appointments.AppointmentResourceTypeGet(resource.Type); 
                int key = (int)resource.Key; 
                string text = (string)resource.Text; 
                if (key > 0) Appointments.AppointmentResourceUpdateSingle(appt.AppointmentID, key); 
            } 
        } 


Can anyone help me determine what I might be doing wrong here that would cause the control to not display the updated appointment information?  Thanks in advance.

3 Answers, 1 is accepted

Sort by
0
Burl
Top achievements
Rank 2
answered on 19 Dec 2009, 04:26 AM
Hi Jeremy,

In your datasources Updated Event, make a call to your radscheduler.Rebind method.

Burl
0
Jeremy Hoehn
Top achievements
Rank 1
answered on 19 Dec 2009, 11:20 PM
Thanks for the response.  But that doesn't seem to work either.  I'm not doing any rebinding or anything on the inserts or deletes and those are updating the control properly.  It's just the update that isn't refreshing the displayed appointment.  Any other ideas?
0
Peter
Telerik team
answered on 22 Dec 2009, 11:47 AM
Hello Jeremy,

At the end of your AppointmentUpdate handler, try setting the datasource for RadScheduler again and calling DataBind(). Does this help?


Greetings,
Peter
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
Tags
Scheduler
Asked by
Jeremy Hoehn
Top achievements
Rank 1
Answers by
Burl
Top achievements
Rank 2
Jeremy Hoehn
Top achievements
Rank 1
Peter
Telerik team
Share this question
or