DayPilot Pro 5.9 will be able to detect Ctrl and Shift key status during drag&drop move operation.
Ctrl and Shift key status is saved in "ctrl" and "shift" variables available to the JavaScript EventMove handler (EventMoveJavaScript).
Client side
EventMoveJavaScript="dpc.eventMoveCallBack(e, newStart, newEnd, newResource, {ctrl: ctrl, shift: shift} )"
Server side (C#)
protected void DayPilotScheduler1_EventMove(object sender, DayPilot.Web.Ui.Events.EventMoveEventArgs e) { bool shift = (bool) e.Data["shift"]; bool ctrl = (bool) e.Data["ctrl"]; if (ctrl) { // copy the event in the DB (INSERT) } else if (shift) { // move the event in the DB (UPDATE) } setDataSourceAndBind(); // custom method that loads the data from a DB, assigns DataSource and calls DataBind() DayPilotScheduler1.Update("Event moved"); }
Server side (VB.NET)
Protected Sub DayPilotScheduler1_EventMove(ByVal sender As Object, ByVal e As DayPilot.Web.Ui.Events.EventMoveEventArgs) Handles DayPilotScheduler1.EventMove Dim shift As Boolean = CType(e.Data("shift"), Boolean) Dim ctrl As Boolean = CType(e.Data("ctrl"), Boolean) If ctrl Then ' copy the event in the DB (INSERT) ElseIf shift Then ' move the event in the DB (UPDATE) End If setDataSourceAndBind() ' custom method that loads the data from a DB, assigns DataSource and calls DataBind() As setDataSourceAndBind() DayPilotScheduler1.Update("Event moved") End Sub
EventMoveJavaScript="if (ctrl) yourCopyOperation(e, newStart, newEnd, newResource); else if (shift) yourMoveOperation(e, newStart, newEnd, newResource) else yourDefaultOperation(e, newStart, newEnd, newResource);"
It's necessary to handle the status properly on the server side.
Available: DayPilot Pro for ASP.NET build 5.8.1968