Deleting a series_ differentiate between whole series and one appointment

Hi,

SfSchedule asks at deletion, if I want to delete the whole series or only the one appointment I selected. 

But how can I differentiate programmatically between whose two? 

At OnActionBegin(Syncfusion.Blazor.Schedule.ActionEventArgs<Appointment> args) I do not see a difference in the content of args between those two possibilities. 

This is what the debugger gives me: 

Image_5498_1709537339110


How can I differentiate if only one appointment in a series has to be deleted or the whole series? 

Also the item in "ChangedRecords" looks totally the same. Or is there a special property which has to be set? 



1 Reply

RR Ram Raju Elaiyaperumal Syncfusion Team March 12, 2024 01:00 PM UTC

Hi Jens,

In the Syncfusion Blazor Scheduler, you can differentiate between deleting a single occurrence and the entire series by using the CurrentAction property. This property will return DeleteOccurrence when a single event is being deleted, and DeleteSeries when the entire series is being deleted.


Here's a sample code snippet demonstrating how you can use this property in the OnActionBegin method:

    public SfSchedule<AppointmentData> ScheduleRef;

 

    public void OnActionBegin(ActionEventArgs<AppointmentData> args)

    {

        if (args.ActionType == ActionType.EventRemove)  

        {

            //ScheduleRef.CurrentAction: DeleteSeries

            // ScheduleRef.CurrentAction: DeleteOccurrence

            if( ScheduleRef.CurrentAction == “DeleteSeries”) {

              

            }

            else if(ScheduleRef.CurrentAction == “DeleteSeries”) { }

        }

    }


In this code, ScheduleRef.CurrentAction will hold the value that indicates whether a single occurrence or the entire series is being deleted. You can then use this value to execute the appropriate deletion logic



Regards,

Ram


Loader.
Up arrow icon