Is it possible to group by code appointments for drag n drop ?

Hello,


Is it possible to group by code several appointments to drag n drop the entire group from a resource to another resource ?

For instance, move the orange appoitnements from Nancy to Michael ?


I would like a comportment like AllowMultiDrag but without have to select one by one each appotment with Ctrl Key and avoid possibility to change hours of the group.


Have a nice day


1 Reply

SK Satheesh Kumar Balasubramanian Syncfusion Team March 16, 2022 05:42 PM UTC

Hi Kevin,

I would like a comportment like AllowMultiDrag but without have to select one by one each appotment with Ctrl Key

We don't have any other option to select each appointment without Ctrl Key.

avoid possibility to change hours of the group

We suggest you to use the below customization in OnDragStart and Dragged event to achieve your requirement.


Index.razor: 
    public async Task OnDragged(DragEventArgs<AppointmentData> args)
    {
        for (int i = 0; i < Data.Count(); i++)
        {
            if (Data[i].OwnerId != args.SelectedData[i].OwnerId)
            {
                args.SelectedData[i].StartTime = Data[i].StartTime;
                args.SelectedData[i].EndTime = Data[i].EndTime;
            }
        }
        Data.Clear();
    }
    public void OnDragStart(DragEventArgs<AppointmentData> args)
    {
        if (args.SelectedData != null && args.SelectedData.Count > 0)
        {
            for (int i = 0; i < args.SelectedData.Count; i++)
            {
                Data.Add(new AppointmentData
                {
                    StartTime = args.SelectedData[i].StartTime,
                    EndTime = args.SelectedData[i].EndTime,
                    OwnerId = args.SelectedData[i].OwnerId
                });
            }
        }
    }

Kindly try the above sample and let us know if this meets your requirement.

Regards,
Satheesh Kumar B


Loader.
Up arrow icon