# scheduler-external-drag-and-drop

> Scheduler with a waiting list that supports dragging external items into resource timelines.

**Framework:** aspnet-core  **Component:** Scheduler  **Variant:** external-drag-and-drop

## Get this item

**If you are an agent, fetch the JSON.** Source is inlined, so one request is enough and no tooling is required:

```
GET https://ai.syncfusion.com/r/aspnet-core/scheduler-external-drag-and-drop.json
```

**Install Package(s)**

```bash
dotnet add package Syncfusion.AspNetCore.Schedule
```

**Notes**

- Syncfusion release: 2026 Volume 3 (v35.1.37)
- The Syncfusion package is licensed. The composition in this file is source you own and edit. See https://ai.syncfusion.com/licensing.md

## Source files

### src/components/scheduler-external-drag-and-drop/scheduler.cshtml

```cshtml
@page
@namespace aspnet_core.Scheduler.ExternalDragAndDrop
@model EJ2CoreSampleBrowser.Scheduler.ExternalDragAndDrop.ExternalDragAndDropModel
@using Syncfusion.EJ2

    <div class="control-section">
        <div class="content-wrapper" style="display: flex; gap: 12px;">
            <div style="width: 220px;">
                <div class="schedule-header" style="font-weight: 600; padding: 6px 0;">Waiting List</div>
                <div id="waiting-list">
                    @foreach (var item in Model.WaitingItems)
                    {
                        <div class="waiting-item" draggable="true" data-id="@item.Id" style="border: 1px solid #ccc; padding: 6px; margin-bottom: 6px; cursor: grab;">
                            <div>@item.Name</div>
                            <div style="font-size: 11px; color: #666;">@item.Role</div>
                        </div>
                    }
                </div>
            </div>
            <div style="flex: 1;">
                <ejs-schedule id="schedule" height="650px" selectedDate="@Model.SelectedDate">
                    <e-schedule-eventsettings dataSource="@Model.Appointments"></e-schedule-eventsettings>
                    <e-schedule-views>
                        <e-schedule-view option="Day"></e-schedule-view>
                        <e-schedule-view option="Week"></e-schedule-view>
                        <e-schedule-view option="WorkWeek"></e-schedule-view>
                        <e-schedule-view option="Month"></e-schedule-view>
                    </e-schedule-views>
                </ejs-schedule>
            </div>
        </div>
    </div>

    <script>
        // Allow dragging items from the waiting list into the schedule.
        document.addEventListener('DOMContentLoaded', function () {
            document.querySelectorAll('.waiting-item').forEach(function (el) {
                el.addEventListener('dragstart', function (e) {
                    e.dataTransfer.setData('text/plain', e.target.dataset.id);
                });
            });
            var scheduler = document.getElementById('schedule');
            if (scheduler) {
                scheduler.addEventListener('dragover', function (e) { e.preventDefault(); });
                scheduler.addEventListener('drop', function (e) {
                    e.preventDefault();
                    var id = e.dataTransfer.getData('text/plain');
                    var item = document.querySelector('[data-id="' + id + '"]');
                    if (item && scheduler.ej2_instances && scheduler.ej2_instances[0]) {
                        // For brevity, just remove the dragged item from the
                        // waiting list. A full implementation would call
                        // scheduler.openAddDialog or add an appointment here.
                        item.remove();
                    }
                });
            }
        });
    </script>

```

### src/components/scheduler-external-drag-and-drop/scheduler.cshtml.cs

```cs
using System;
using System.Collections.Generic;
using Microsoft.AspNetCore.Mvc.RazorPages;

namespace EJ2CoreSampleBrowser.Scheduler.ExternalDragAndDrop
{
    public class ExternalDragAndDropModel : PageModel
    {
        public DateTime SelectedDate { get; set; } = DateTime.Today;
        public List<WaitingItem> WaitingItems { get; set; }
        public List<SchedulerAppointment> Appointments { get; set; }

        public void OnGet()
        {
            WaitingItems = new List<WaitingItem>
            {
                new WaitingItem { Id = 1, Name = "Person One",   Role = "Reviewer" },
                new WaitingItem { Id = 2, Name = "Person Two",   Role = "Presenter" },
                new WaitingItem { Id = 3, Name = "Person Three", Role = "Note taker" },
            };
            Appointments = new List<SchedulerAppointment>
            {
                new SchedulerAppointment
                {
                    Id = 1, Subject = "Kickoff meeting",
                    StartTime = SelectedDate.AddHours(9),
                    EndTime = SelectedDate.AddHours(10),
                },
                new SchedulerAppointment
                {
                    Id = 2, Subject = "Daily standup",
                    StartTime = SelectedDate.AddDays(1).AddHours(9),
                    EndTime = SelectedDate.AddDays(1).AddHours(9.5),
                    RecurrenceRule = "FREQ=DAILY;INTERVAL=1",
                },
            };
        }
    }

    public class WaitingItem
    {
        public int Id { get; set; }
        public string Name { get; set; }
        public string Role { get; set; }
    }

    public class SchedulerAppointment
    {
        public int Id { get; set; }
        public string Subject { get; set; }
        public DateTime StartTime { get; set; }
        public DateTime EndTime { get; set; }
        public string RecurrenceRule { get; set; }
    }
}

```
