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 and drop from Grid to Schedule

Hi,

I have a requirement that i want to drag and drop a resourse from a grid/HTML to schedule.
I have found a solution in syncfusion essential studio samples but in that example start time and end time mentioned based on that it will create schedule.

But my requirement is i have just number of hours present in grid instead of start time and end time. When i drag and drop that how to find start time position in scheduling grid.

Kindly help in this. I need this urgently.

Please provide help.

Thanks in advance,
Arun

1 Reply

LK Lakxman Kumar C Syncfusion Team July 21, 2010 03:38 PM UTC

Hi Arun,

Thank you for your interest in Syncfusion Products.

It is possible to add the appointments by dropping the grid records with the Total Hours. You can use the ExternalAppointmentDragging event and get the start time where the record is dropped by using the “StartTime” property of the ExternalAppointmentDragging event args. You can add the hours to the start time to compute the end time and add it to the schedule. Kindly find the code snippet below to achieve this.

[C#]

protected void schedule1_ExternalAppointmentDragging(object sender, Syncfusion.Web.UI.WebControls.ScheduleControl.ExternalAppointmentDraggingEventArgs e)
{
string shr = e.Data.Split(',')[2]; //get hours from grid
DateTime starttime = e.StartTime; //get Starttime where you drop the Resource in Schedule
int hr = int.Parse(shr);
DateTime endtime = starttime.AddHours(hr);
//Here the appointments can be added to the schedule using the start time and end time.
}


Kindly try the above and please let us know if any concerns.

Regards,
Lakxman Kumar C

Loader.
Live Chat Icon For mobile
Up arrow icon