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

[Solved] Dragging vs Inline vs Advanced Editting

3 Answers 82 Views
Scheduler
This is a migrated thread and some comments may be shown as answers.
James Legan
Top achievements
Rank 1
James Legan asked on 22 Oct 2009, 07:07 PM
I am handling appointment updates server-side with OnAppointmentUpdate.

I have run into a situation where I need to programatically handle the update differently whether the user drag and moved/extended the appointment vs updating it from the advanced form. Is there a mechnism in the control to tell where the update was initiated, possibly keying off of the button, etc...?

Thanks,

Jim

3 Answers, 1 is accepted

Sort by
0
James Legan
Top achievements
Rank 1
answered on 22 Oct 2009, 07:20 PM
In the interim (in case anyone else is looking for a solution), I set an onclick event to my advanced edit form button to set a bool in the viewstate and key off of that. However, if the control has a way to do that natively I would prefer it.
0
Peter
Telerik team
answered on 23 Oct 2009, 02:01 PM
Hi James,

I was tempted to suggest you compare the End time of the original and modified appointment:
protected void RadScheduler1_AppointmentUpdate(object sender, Telerik.Web.UI.AppointmentUpdateEventArgs e)
   {
       if (DateTime.Compare(e.Appointment.End, e.ModifiedAppointment.End) == 0)
       {
           Response.Write("Appointment was updated through the advanced edit form");
       }
       else
       {
           Response.Write("appointment was updated through drag or resize");
       }
   }

But, this will fail if the user opens the advanced edit form and changes the end time. 

A safer approach is to check if the advanced form was opened at all, but then this will require using a view state or a hidden field to keep track if the event occured:
protected void RadScheduler1_FormCreated(object sender, Telerik.Web.UI.SchedulerFormCreatedEventArgs e)
    {
        if (e.Container.Mode == Telerik.Web.UI.SchedulerFormMode.AdvancedEdit)
        {
            ViewState["AdvancedEditMode"] = "true";
        }
    }
 

Regards,
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.
0
James Legan
Top achievements
Rank 1
answered on 27 Oct 2009, 10:29 AM
Peter,

The ViewState is the route I went before I read your post. However, I attached to ViewState update to the "OK" button in the Advanced Form dialog. This avoids having to handle the user cancelling out of the UI.

Thanks,

Jim
Tags
Scheduler
Asked by
James Legan
Top achievements
Rank 1
Answers by
James Legan
Top achievements
Rank 1
Peter
Telerik team
Share this question
or