We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date

Drag & Drop

Hi,

I tried to implement the D&D functionality. Unfortunatly I am confused and don't know what events to use (calender, ScheduleHost ...).
As a work arround I thought I just turn the d&d off ... but could not even find a property for that.

Do you have a tutorial for D&D or could you point me to right location in the Help?

Thank you

8 Replies

AD Administrator Syncfusion Team October 1, 2007 03:52 PM UTC

What do you mean by drag and drop?

In the samples we ship, you can mousedown on one appointment and move it to another location? Do you need some kind of drag and drop support beyond this default support that we provide out of the box?


SA Samy Abou-Shama October 1, 2007 04:41 PM UTC

Sorry for not being specific :-)

I meant dragin a ScheduleItem from one date to another.


AD Administrator Syncfusion Team October 1, 2007 05:35 PM UTC

This is supported out of the box in the recurring appointment sample we ship. You can drag an appointment from one date to another in a Month view, or week view or Work Week or Custom view.

You can also drag an appointment from one of these views and drop it on a date in the Navigation Calendar.

There would be no need to handle any grid events to get this support.


SA Samy Abou-Shama October 1, 2007 06:12 PM UTC

Thank you for the quick answer.

Here is my problem. My ScheduleItems are directly connected to the DB.
Where would I implement the 'persist' of the changed items (changed via d&d)?


AD Administrator Syncfusion Team October 1, 2007 06:38 PM UTC

There is a this.scheduleControl1.ItemChanged event that you can subscribe to and catch any changes that are made to the appointment items.


AD Administrator Syncfusion Team October 2, 2007 08:17 AM UTC

Here is that sample modified to do a Console.WriteLine showing the appointment when an appointment is edited or dragged.

The editing is caught using ScheduleControl.ItemChanged.

To catch the D&D, a derived grid is used. To do this, you derive the ScheduleControl and override CreateScheduleGrid. There, you provide an instance of your derived ScheduleGrid. The code in the derived schedule grid catches the original appointment, and then the dropped appointment. It does require accessing some internal members to do this. At the point of the WriteLine, you could call a member of the ScheduleControl (you would need to add it to your derived schedulecontrol) that would raise a new ScheduleControl ItemDropped event (that you aould also need to add).

We will explicitly add support for such an event in the next release.

SampleSchedule.zip


KU kusumapriya March 27, 2008 09:42 AM UTC



>Hi,

I tried to implement the D&D functionality.But i Dnt no how to write the code for that, plz help me to get that information. BR>
Thank you



AN Anonymous March 27, 2008 12:30 PM UTC

As mentioned above, the normal D&D of appointments around the schedule is supported out of the box. Exactly what kind of D&D are you trying to do that is not part of the built-in support?


Loader.
Live Chat Icon For mobile
Up arrow icon