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

[Solved] Client-Side Confirmation on Appointment Movement

3 Answers 144 Views
Scheduler
This is a migrated thread and some comments may be shown as answers.
JK
Top achievements
Rank 1
JK asked on 25 Oct 2007, 01:03 PM
Hi,

I have two questions over the Movement of the appointment.

1.  How can I setup confirmation if I move an appointment?  i already have got JS confirmations if you adjust the size of the appointment, cannot see how this is done for general movement.
2. If the user either drags/creates a appointment into the past (< now()) how can I get a confirmation box up?

Thanks,

JK

3 Answers, 1 is accepted

Sort by
0
Peter
Telerik team
answered on 29 Oct 2007, 08:49 AM
Hi Jon,

Thank you for your questions.

1. Currently, this is not possible since we don't expose an OnClientAppointmentMove event. However, we will consider implementing such a property in the future. 

2. You can use the  DateTime.Compare(t1,t2) method in combination with the AppointmentCreated event for the case of creating a new appointment and the AppointmentUpdate event for the case of dragging a appointment. Here is a code sample:

 //Creating a new appointment:  
    protected void RadScheduler1_AppointmentCreated(object sender, Telerik.Web.UI.AppointmentCreatedEventArgs e)  
    {  
        if (DateTime.Compare(e.Appointment.Start.Date, System.DateTime.Now) != 1)  
        {  
            Response.Write("Appointement is scheduled in the past");  
        }  
        else 
        {  
            Response.Write("Appointement is scheduled in the future");  
        }  
    }  
    //Dragging an appointment:  
    protected void RadScheduler1_AppointmentUpdate(object sender, Telerik.Web.UI.AppointmentUpdateEventArgs e)  
    {  
        if (DateTime.Compare(e.ModifiedAppointment.Start.Date, System.DateTime.Now) != 1 )  
        {  
            Response.Write("Appointement is moved in the past");  
        }  
        else 
        {  
            Response.Write("Appointement is moved in the future");  
        }  
    } 



Kind regards,
Peter
the Telerik team

Instantly find answers to your questions at the new Telerik Support Center
0
JK
Top achievements
Rank 1
answered on 29 Oct 2007, 10:32 AM
Thanks Peter,

1 How would I go around making a request to get this appointmentmove event added to a susequent version of scheduler?

2.  Had to alter your code slightly as the appointmentcreated event fires after each time the template is used, which means in this case it fires for all appointments the first time round (when databound).

Instead, I placed your code in the formcreating event but had to change the "start.date" part to "e.time" as follows...
if (DateTime.Compare(e.Time, System.DateTime.Now) < 0)  
 
{  
 
// this is in the past  
 
}  
 

Thanks for you help.

JK

0
Peter
Telerik team
answered on 29 Oct 2007, 01:40 PM
Hi Jon,

Thanks for the feedback. We have already logged your feature request so you don't need to do anything additionally.


Cheers,
Peter
the Telerik team

Instantly find answers to your questions at the new Telerik Support Center
Tags
Scheduler
Asked by
JK
Top achievements
Rank 1
Answers by
Peter
Telerik team
JK
Top achievements
Rank 1
Share this question
or