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

Scheduler - Drag/Drop recurring event

Hi,

Trying to drag/drop a recurring event but I am getting the alert for "Two occurrences of the same event cannot occur on the same day" even when dragging to a date that the event is not already occurring on. This raises a couple of additional questions regarding the drag/drop of a recurring event:

  • When dragging a recurring event, should the scheduler not add the start time of the dragged event to the recurrence exception of the parent event and then create a clone of the dragged event minus the recurrence rule? 
    • Does this need to be done manually within the "Dragged" event of the scheduler as this occurs before the popup is shown? 
  • In scheduler Dragged event I can see that the data object within DragEventArgs is the main parent event object but with the start time adjusted to where the event was dragged TO but that leaves no way to determine which occurrence date it was dragged FROM as it is just updating the start time of the main parent event.
    • For example, in the attached video I drag from the 16th April to the 11th April. Within Dragged handler, the start time of the data object is the 11th but there is no way to determine that it came from the 16th, if we have to handle the creation of a recurrence exception ourselves within Dragged we cannot do this as we don't know which occurrence it originated from.
    • Assuming that we keep this start time provided to us as it is currently within the Dragged event and then handle it within OnActionComplete, this will move the whole recurrence series so that it starts from the 11th and not the 13th when actually we only want to move one specific occurrence.
For reference, the recurrence rule being used in the video is a very simple daily recurrence starting on the 13th April - FREQ=DAILY;INTERVAL=1;

Look forward to your advice, any help is appreciated. 

Kind regards, Lee.

Attachment: Syncfusion__Drag_recurrence_error_90185645.zip

1 Reply

SR Swathi Ravi Syncfusion Team April 13, 2023 09:28 AM UTC

Hi Lee,


Trying to drag/drop a recurring event but I am getting the alert for "Two occurrences of the same event cannot occur on the same day" even when dragging to a date that the event is not already occurring on.


As per current Scheduler architecture, this is the default behaviour. When you drag the occurrence from the in between of series and drop that occurrence to the before series, you can’t drop. If you drag the first event from the occurrence and drop it before the series, you can drop this. As per Outlook and Google calendars standard we are achieved this in our Component.



For your remaining query,


In the Dragged event, we only given the dropped date details. If you want to know where the event dragged from, you can use the Schedule’s OnDragStart event. In that event you can get the details of where the events dragged from, as shown in the below shared snippet.


Api: https://help.syncfusion.com/cr/blazor/Syncfusion.Blazor.Schedule.ScheduleEvents-1.html#Syncfusion_Blazor_Schedule_ScheduleEvents_1_OnDragStart

UG: https://blazor.syncfusion.com/documentation/scheduler/events#ondragstart


[index.razor]

<SfSchedule >

    <ScheduleEvents TValue="AppointmentData" OnDragStart="onDragStart"></ScheduleEvents>

</SfSchedule>

@code {

public void onDragStart(DragEventArgs<AppointmentData> args)

{

        Console.WriteLine(args.StartTime); //you can get the startTime and endTime of where you are dragged from.

        Console.WriteLine(args.EndTime);

}



Regards,

Swathi Ravi


Attachment: blazorschedulerdraganddrop_ee45ce76.zip

Loader.
Up arrow icon