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

What event is triggered when appointment is moved

5 Answers 184 Views
Scheduler and Reminder
This is a migrated thread and some comments may be shown as answers.
Karel
Top achievements
Rank 1
Karel asked on 17 Jul 2012, 11:27 AM
I use scheduler to show appointments. The scheduler is not mapped directly to some db table, so I have to handle persistence by myself. For adding and editing appointment I use CollectionChanged event of Appointments and it seems to work, however when the appointment is moved by dragging, the CollectionChanged  event is fired with Action NotifyCollectionChangedAction.Batch and I don't know what appointment was changed. Can anybody give me a hint how to handle this situation?

Thank you

5 Answers, 1 is accepted

Sort by
0
Ivan Todorov
Telerik team
answered on 19 Jul 2012, 01:06 PM
Hi Karel,

Thank you for your question.

You can use the AppointmentMoved, AppointmentDropped and AppointmentResized events to track changes in an appointment caused by user interaction.

I hope you find this useful. Do not hesitate to ask if you have any other questions.

Kind regards,
Ivan Todorov
the Telerik team
RadControls for WinForms Q2'12 release is now live! Check out what's new or download a free trial >>
0
Karel
Top achievements
Rank 1
answered on 20 Jul 2012, 09:21 PM
Thank you for your answer, but for some reason I don't see the events you are mentioning.

I can see event like AppointmentDeleted or AppointmentSelected, but not AppointmentMove or AppointmentResize, isn't this strange?

0
Ivan Todorov
Telerik team
answered on 24 Jul 2012, 02:56 PM
Hi Karel,

Can you please confirm which version you are using. The events I have mentioned were introduced with Q2 2011 SP1 so if you are using an older version, this would explain why you are not able to see them.

Looking forward to hearing from you.

All the best,
Ivan Todorov
the Telerik team
RadControls for WinForms Q2'12 release is now live! Check out what's new or download a free trial >>
0
Karel
Top achievements
Rank 1
answered on 26 Jul 2012, 08:37 AM
Hi Ivan,

thank you for your reply, we are using Q2 2011, not the SP1 version, so that might explains why I couldn't access the events you mentioned. Honestly it seems a little bit odd to me that in the previous version you didn't have those events as they seem logical to me. Anyway what could I use to achieve what I want without the those events?

Thank you for your help
0
Ivan Todorov
Telerik team
answered on 30 Jul 2012, 11:09 AM
Hello Karel,

There is no easy way to achieve your requirements in the version you are using. Some of the events are available through the DragDropBehavior of RadSchedulerElement. However this behavior is occasionally reinitialized and you can lose your event handlers. Also, this behavior is not used when resource grouping is applied.

A possible approach I can think of is to check whether the Batch update was caused by the DragDropBehavior. Here is how you should implement this:
void Appointments_CollectionChanged(object sender, Telerik.WinControls.Data.NotifyCollectionChangedEventArgs e)
{
    if (e.Action == Telerik.WinControls.Data.NotifyCollectionChangedAction.Batch)
    {
        if (this.radScheduler1.SchedulerElement.DragDropBehavior.IsDragging)
        {
            UpdateAppointment(this.radScheduler1.SchedulerElement.DragDropBehavior.ActiveFeedback.AssociatedAppointment);
        }
    }
}

In all other cases when you receive a Batch update, you should update all appointments to make sure that your database is consistent.

I hope this will help. Feel free to ask if you have any additional questions.

All the best,
Ivan Todorov
the Telerik team
RadControls for WinForms Q2'12 release is now live! Check out what's new or download a free trial >>
Tags
Scheduler and Reminder
Asked by
Karel
Top achievements
Rank 1
Answers by
Ivan Todorov
Telerik team
Karel
Top achievements
Rank 1
Share this question
or