This is a migrated thread and some comments may be shown as answers.
Different snap behavior for appointments
7 Answers 66 Views
This is a migrated thread and some comments may be shown as answers.
Christian Burkhardt
Top achievements
Rank 1
Christian Burkhardt asked on 10 May 2011, 01:55 PM
Hi,

I need to change the snap behavior depending on the appointment properties. For example, if an appointment (custom) has a property Planned, I know that this appointment was already been planned and the user should be able to drop the assignment on a different resource but at the same time interval.

I can do the snap easily for all appointments  by using a custom SnapBehaviour which inherits from DefaultSnapBehavior, but I can't find a way to modify the snap behaviour depending on the appointment properties. The problem I have is that I can't get the appointment in the SnapBehaviour class.

Is there any way in which I can do this?

Thanks

7 Answers, 1 is accepted

Sort by
0
Rosi
Telerik team
answered on 13 May 2011, 07:51 AM
Hi Christian ,

At this stage I cannot suggest you a way to implement the task by using the SnapBehaviour. You can try complete the task by using a custom Drad Drop behavior and override the Drop method.

Greetings,
Rosi
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
Santor
Top achievements
Rank 1
answered on 26 Jul 2011, 07:34 AM
Hi Rosi,

I have the same problem as  Christian.
So I'm trying to override the Drop method, but is it possible to raise the AppointmentCreated event from within my own drop method? 

Greetings,
Santor

0
Ken
Top achievements
Rank 1
answered on 27 Jul 2011, 02:06 PM
Hi,

Any news about this in q2 2011? Is there a way to define snapping during a drag&drop operation from an external source, depending on some values on the dragged data?

Thanks!
0
Valeri Hristov
Telerik team
answered on 27 Jul 2011, 02:44 PM
The snap behavior still cannot access the appointments' properties in order to provide different snap logic for the different appointments.

Best wishes,
Valeri Hristov
the Telerik team

Register for the Q2 2011 What's New Webinar Week. Mark your calendar for the week starting July 18th and book your seat for a walk through of all the exciting stuff we will ship with the new release!

0
Ken
Top achievements
Rank 1
answered on 27 Jul 2011, 02:46 PM
Hmm...I was just playing with it. What I did in a behavior that inherits from DefaultSnapBehavior was to overwrite SnapStart and SnapEnd and there, in the SnapData parameter you can get the OriginalData, which looks to be actually the original Appointment (or derived class), or in case of a drag&drop the Occurrence instance (from which you can get the Appointment). So if I cast it appropriately I can get to its data and return a snap date appropriately.

This seems to work, am I doing something wrong? :)
0
Valeri Hristov
Telerik team
answered on 27 Jul 2011, 02:52 PM
Hi Adrian,

You are correct, the OriginalData property sometimes contains the appointment that is being snapped (when resizing the OriginalData is not the appointment), but I should warn you that this might change in the future versions of the control.

Best wishes,
Valeri Hristov
the Telerik team

Register for the Q2 2011 What's New Webinar Week. Mark your calendar for the week starting July 18th and book your seat for a walk through of all the exciting stuff we will ship with the new release!

0
Ken
Top achievements
Rank 1
answered on 27 Jul 2011, 02:57 PM
Hi Valeri,

Thanks for the answer. Hopefully if it changes in the future, it will be for the better :)

Ciao,
Adrian
Asked by
Christian Burkhardt
Top achievements
Rank 1
Answers by
Rosi
Telerik team
Santor
Top achievements
Rank 1
Ken
Top achievements
Rank 1
Valeri Hristov
Telerik team
Share this question
or