# scheduler-external-drag-and-drop

> Scheduler with a waiting list that supports dragging external items into resource timelines.

**Framework:** aspnet-mvc  **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-mvc/scheduler-external-drag-and-drop.json
```

**Install Package(s)**

```bash
Install-Package Syncfusion.AspNetMvc.Schedule
Install-Package Syncfusion.AspNetMvc.Navigations
```

**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
@using Syncfusion.EJ2
@using Syncfusion.EJ2.Schedule

@section ControlsSection{
    <div class="control-section">
        <div class="content-wrapper">
            <div class="schedule-container">
                <div class="title-container">
                    <div class="title-text">Doctor's Appointments</div>
                </div>
                @Html.EJS().Schedule("schedule").Width("100%").Height("650px").CssClass("schedule-drag-drop").Views(view => { view.Option(View.TimelineDay).Add(); view.Option(View.TimelineMonth).Add(); }).CurrentView(View.TimelineDay).SelectedDate(new DateTime(DateTime.Today.Year, 7, 2)).WorkHours(new ScheduleWorkHours { Highlight = true, Start = "08:00", End = "18:00" }).Group(group => group.EnableCompactView(false).Resources((string[])ViewData["Resources"])).Resources(res =>
                    {
                        res.DataSource(ViewData["Departments"]).Field("DepartmentID").Title("Department").Name("Departments").TextField("text").IdField("id").ColorField("color").Add();
                        res.DataSource(ViewData["Consultants"]).Field("ConsultantID").Title("Consultant").Name("Consultants").TextField("text").IdField("id").ColorField("color").GroupIDField("groupId").AllowMultiple(false).Add();
                    }).ResourceHeaderTemplate("#resource-template").ActionBegin("OnActionBegin").EventSettings(e => e.Fields(f => f.Subject(sub => sub.Name("Name").Title("Patient Name")).StartTime(start => start.Name("StartTime").Title("From")).EndTime(end => end.Name("EndTime").Title("To")).Description(des => des.Name("Description").Title("Reason"))).DataSource(ViewData["datasource"])).Render()
            </div>
            <div class="treeview-container">
                <div class="title-container">
                    <div class="title-text">Waiting List</div>
                </div>
                @Html.EJS().TreeView("tree").Fields(fields => fields.DataSource(ViewData["treeDataSource"]).Id("Id").Text("Name")).AllowDragAndDrop(true).NodeDragStop("OnTreeDragStop").NodeDragging("onTreeDrag").NodeDragStart("onTreeDragStart").NodeTemplate("#treeTemplate").DragArea(".content-wrapper").CssClass("treeview-external-drag").Render()
            </div>
        </div>
    </div>

    <style>
        .content-wrapper {
            display: -ms-flexbox;
            display: flex;
        }

        .e-device-hover {
            background-color: #e0e0e0 !important;
        }

        .schedule-container {
            padding-right: 10px;
            width: 100%;
        }

        .title-container {
            padding-bottom: 10px;
        }

        .title-text {
            font-size: 18px;
            margin: 0px;
            font-weight: bold;
            text-align: center;
            line-height: 1.1;
        }

        .treeview-external-drag #waiting {
            height: 100%;
            padding: 0;
        }

        .treeview-external-drag #waitdetails {
            width: 95%;
            float: left;
            height: 100%;
            padding: 0;
        }

        .treeview-external-drag #waitlist {
            width: 100%;
            height: 50%;
            font-weight: bold;
            font-family: "Segoe UI";
            font-size: 12px;
            padding: 5px 0 0 10px;
            overflow: hidden;
            text-overflow: ellipsis;
        }

        .treeview-external-drag #waitcategory {
            height: 50%;
            font-family: "Segoe UI";
            font-size: 10px;
            opacity: 0.6;
            padding-left: 10px;
            padding-top: 5px;
            overflow: hidden;
            text-overflow: ellipsis;
        }

        .treeview-external-drag .e-list-text,
        .e-bigger .treeview-external-drag .e-list-text {
            border: 0.5px solid #E1E7EC;
            height: 50px;
            line-height: 15px !important;
            padding: 0 5px;
            width: 220px;
        }

        .treeview-external-drag .e-list-parent,
        .e-bigger .treeview-external-drag .e-list-parent {
            height: 100%;
            padding: 0 2px;
        }

        .treeview-external-drag .e-list-item,
        .e-bigger .treeview-external-drag .e-list-item {
            height: 100%;
            padding: 0 0 5px 0;
        }

        .treeview-external-drag .e-fullrow,
        .e-bigger .treeview-external-drag .e-fullrow {
            height: 55px;
        }

        .treeview-external-drag .e-list-item.e-hover > .e-fullrow,
        .treeview-external-drag .e-list-item.e-active > .e-fullrow,
        .treeview-external-drag .e-list-item.e-active.e-hover > .e-fullrow,
        .e-bigger .treeview-external-drag .e-list-item.e-hover > .e-fullrow,
        .e-bigger .treeview-external-drag .e-list-item.e-active > .e-fullrow,
        .e-bigger .treeview-external-drag .e-list-item.e-active.e-hover > .e-fullrow {
            background-color: transparent;
            border-color: transparent;
            box-shadow: none !important;
        }

        .fluent2-highcontrast .treeview-external-drag .e-list-item.e-hover > .e-text-content .e-list-text {
            color: #fff;
        }

        .treeview-external-drag .e-text-content,
        .e-bigger .treeview-external-drag .e-text-content {
            padding: 0;
            background-color: inherit;
        }

        .e-drag-item.e-treeview.treeview-external-drag,
        .e-bigger .e-drag-item.e-treeview.treeview-external-drag {
            padding: 0 !important;
        }

        .e-schedule.schedule-drag-drop .e-timeline-view .e-resource-left-td,
        .e-schedule.schedule-drag-drop .e-timeline-month-view .e-resource-left-td {
            width: 160px;
        }

        .e-schedule.schedule-drag-drop .e-resource-cells.e-parent-node .specialist-category {
            padding-left: 30px
        }

        .e-schedule.e-rtl.schedule-drag-drop .e-resource-cells.e-parent-node .specialist-category {
            padding-right: 30px
        }

        .e-schedule.schedule-drag-drop .e-resource-cells.e-child-node .specialist-category,
        .e-schedule.schedule-drag-drop .e-resource-cells.e-child-node .specialist-name {
            padding: 5px
        }

        .e-schedule.schedule-drag-drop .e-resource-cells.e-parent-node .specialist-name {
            padding: 0 10px
        }

        .e-schedule.schedule-drag-drop .e-resource-cells.e-parent-node .template-wrap {
            padding: 3px 0px;
        }

        .e-schedule.schedule-drag-drop .e-resource-cells.e-child-node .specialist-category .specialist-image {
            width: 45px;
            height: 40px;
            float: left;
            border-radius: 50%;
            margin-right: 10px;
        }

        .e-schedule.schedule-drag-drop .specialist-name {
            font-size: 13px;
        }

        .e-schedule.schedule-drag-drop .specialist-designation {
            font-size: 10px;
        }

        .e-schedule-dialog .e-all-day-time-zone-row,
        .e-schedule-dialog .e-location-container,
        .e-bigger .e-schedule-dialog .e-all-day-time-zone-row,
        .e-bigger .e-schedule-dialog .e-location-container {
            display: none;
        }

        .e-schedule-dialog .e-subject-container,
        .e-bigger .e-schedule-dialog .e-subject-container {
            padding-right: 0;
            width: 100%;
        }

        .e-schedule-dialog.e-rtl .e-subject-container,
        .e-bigger .e-schedule-dialog.e-rtl .e-subject-container {
            padding-left: 0;
        }

        @@media (max-width: 550px) {
            /* custom code start*/
            .content-wrapper {
                display: block;
            }

            .schedule-container {
                padding-bottom: 10px
            }
            /* custom code end*/

            .treeview-external-drag.e-treeview,
            .e-bigger .treeview-external-drag.e-treeview {
                width: 250px;
            }

                .e-bigger .treeview-external-drag.e-treeview.e-drag-item {
                    position: relative !important;
                }
        }
        .e-disble-not-allowed {
            cursor: unset !important;
        }
        .e-drag-item.treeview-external-drag .e-icon-expandable {
            display: none;
        }
    </style>

    <!-- Template to render tree node -->
    <script id="treeTemplate" type="text/x-template">
        <div id="waiting">
            <div id="waitdetails">
                <div id="waitlist">${Name}</div>
                <div id="waitcategory">${DepartmentName} - ${Description}</div>
            </div>
        </div>
    </script>

    <!-- Resource Header Template -->
    <script id="resource-template" type="text/x-template">
        <div class="template-wrap">
            <div class="specialist-category">
                ${getConsultantImage(data)}
                <div class="specialist-name">${getConsultantName(data)}</div>
                <div class="specialist-designation">${getConsultantDesignation(data)}</div>
            </div>
        </div>
    </script>

    <script type="text/javascript">

        function getConsultantName(value) {
            return value.resourceData[value.resource.textField];
        };

        function getConsultantImage(value) {
            var resourceName = value.resourceData[value.resource.textField];
            if (resourceName === 'GENERAL' || resourceName === 'DENTAL') {
                return '';
            } else {
                var path = "@Url.Content("~/Content/schedule/images/")";
                var src = path + resourceName.toLowerCase() + ".png";
                return '<img class="specialist-image" src=' + src + '></img>';
            }
        };

        function getConsultantDesignation(value) {
            var resourceName = value.resourceData[value.resource.textField];
            if (resourceName === 'GENERAL' || resourceName === 'DENTAL') {
                return '';
            } else {
                return value.resourceData.designation;
            }
        };

        var isTreeItemDropped = false;
        var draggedItemId = '';

        function onTreeDrag(event) {
            var scheduleObj = document.querySelector(".e-schedule").ej2_instances[0];
            if (scheduleObj.isAdaptive) {
                var classElement = scheduleObj.element.querySelector('.e-device-hover');
                if (classElement) {
                    classElement.classList.remove('e-device-hover');
                }
                if (event.target.classList.contains('e-work-cells')) {
                    ej.base.addClass([event.target], 'e-device-hover');
                }
            }
        }

        function OnActionBegin(event) {
            if (event.requestType === 'eventCreate' && isTreeItemDropped) {
                var treeObj = document.querySelector(".e-treeview.treeview-external-drag").ej2_instances[0];
                var treeViewdata = treeObj.fields.dataSource;
                var filteredPeople = treeViewdata.filter(function (item) { return item.Id !== parseInt(draggedItemId, 10); });
                treeObj.fields.dataSource = filteredPeople;
                var elements = document.querySelectorAll('.e-drag-item.treeview-external-drag');
                for (var i = 0; i < elements.length; i++) {
                    remove(elements[i]);
                }
            }
        }

        function OnTreeDragStop(event) {
            var treeElement = ej.base.closest(event.target, '.e-treeview');
            var scheduleObj = document.querySelector(".e-schedule").ej2_instances[0];
            var classElement = scheduleObj.element.querySelector('.e-device-hover');
            if (classElement) {
                classElement.classList.remove('e-device-hover');
            }
            if (!treeElement) {
                event.cancel = true;
                var scheduleElement = ej.base.closest(event.target, '.e-content-wrap');
                if (scheduleElement) {
                    var treeviewData = this.fields.dataSource;
                    if (event.target.classList.contains('e-work-cells')) {
                        var filteredData =
                            treeviewData.filter(function (item) { return item.Id === parseInt(event.draggedNodeData.id, 10); });
                        var cellData = scheduleObj.getCellDetails(event.target);
                        var resourceDetails = scheduleObj.getResourcesByIndex(cellData.groupIndex);
                        var eventData = {
                            Name: filteredData[0].Name,
                            StartTime: cellData.startTime,
                            EndTime: cellData.endTime,
                            IsAllDay: cellData.isAllDay,
                            Description: filteredData[0].Description,
                            DepartmentID: resourceDetails.resourceData.groupId,
                            ConsultantID: resourceDetails.resourceData.id
                        };
                        scheduleObj.openEditor(eventData, 'Add', true);
                        isTreeItemDropped = true;
                        draggedItemId = event.draggedNodeData.id;
                    }
                }
            }
            document.body.classList.remove('e-disble-not-allowed');
        }
        function onTreeDragStart() {
           document.body.classList.add('e-disble-not-allowed');
        }
    </script>
}
```

### src/components/scheduler-external-drag-and-drop/SchedulerController.cs

```cs
using EJ2MVCSampleBrowser.Models;
using System;
using System.Collections.Generic;
using System.Web.Mvc;

namespace EJ2MVCSampleBrowser.Models
{
    using EJ2MVCSampleBrowser.Controllers.Schedule;

    public class ResourceDataSourceModel
    {
        public string text;
        public int id;
        public string color;
        public int groupId;
    }

    public class ConsultantDataSourceModel
    {
        public string text;
        public int id;
        public int groupId;
        public string color;
        public string designation;
    }

    public class ScheduleData
    {
        public class ResourceData
        {
            public int Id;
            public string Subject;
            public DateTime StartTime;
            public DateTime EndTime;
            public bool IsAllDay;
            public string ProjectName;
            public string CategoryName;
        }

        public List<ResourceData> GetResourceData()
        {
            DateTime today = DateTime.Now.Date;
            return new List<ResourceData>
            {
                new ResourceData { Id = 1, Subject = "Project Review",        StartTime = today.AddHours(9),  EndTime = today.AddHours(11),  IsAllDay = false, ProjectName = "PROJECT 1", CategoryName = "Nancy" },
                new ResourceData { Id = 2, Subject = "Sprint Planning",       StartTime = today.AddHours(11), EndTime = today.AddHours(13),  IsAllDay = false, ProjectName = "PROJECT 1", CategoryName = "Steven" },
                new ResourceData { Id = 3, Subject = "Standup",               StartTime = today.AddHours(14), EndTime = today.AddHours(15),  IsAllDay = false, ProjectName = "PROJECT 1", CategoryName = "Nancy" },
                new ResourceData { Id = 4, Subject = "Code Review",           StartTime = today.AddHours(15), EndTime = today.AddHours(17),  IsAllDay = false, ProjectName = "PROJECT 1", CategoryName = "Steven" },
                new ResourceData { Id = 5, Subject = "Design Workshop",       StartTime = today.AddHours(9),  EndTime = today.AddHours(12),  IsAllDay = false, ProjectName = "PROJECT 2", CategoryName = "Nancy" },
                new ResourceData { Id = 6, Subject = "Testing",               StartTime = today.AddHours(13), EndTime = today.AddHours(16),  IsAllDay = false, ProjectName = "PROJECT 2", CategoryName = "Steven" },
                new ResourceData { Id = 7, Subject = "Deployment",            StartTime = today.AddHours(16), EndTime = today.AddHours(18),  IsAllDay = false, ProjectName = "PROJECT 2", CategoryName = "Nancy" },
                new ResourceData { Id = 8, Subject = "Bug Triage",            StartTime = today.AddHours(10), EndTime = today.AddHours(11),  IsAllDay = false, ProjectName = "PROJECT 2", CategoryName = "Steven" },
                new ResourceData { Id = 9, Subject = "Documentation",         StartTime = today.AddHours(11), EndTime = today.AddHours(13),  IsAllDay = false, ProjectName = "PROJECT 2", CategoryName = "Nancy" },
                new ResourceData { Id = 10,Subject = "Demo Day",              StartTime = today.AddHours(15), EndTime = today.AddHours(17),  IsAllDay = false, ProjectName = "PROJECT 2", CategoryName = "Steven" }
            };
        }

        public List<ResourceData> GetTimelineResourceData()
        {
            DateTime today = DateTime.Now.Date;
            return new List<ResourceData>
            {
                new ResourceData { Id = 11, Subject = "Kickoff",            StartTime = today.AddHours(9),  EndTime = today.AddHours(11),  IsAllDay = false, ProjectName = "PROJECT 1", CategoryName = "Steven" },
                new ResourceData { Id = 12, Subject = "Architecture Review", StartTime = today.AddHours(11), EndTime = today.AddHours(14),  IsAllDay = false, ProjectName = "PROJECT 1", CategoryName = "Nancy" },
                new ResourceData { Id = 13, Subject = "Sprint Review",       StartTime = today.AddHours(14), EndTime = today.AddHours(17),  IsAllDay = false, ProjectName = "PROJECT 1", CategoryName = "Steven" },
                new ResourceData { Id = 14, Subject = "Retrospective",       StartTime = today.AddHours(17), EndTime = today.AddHours(18),  IsAllDay = false, ProjectName = "PROJECT 1", CategoryName = "Nancy" },
                new ResourceData { Id = 15, Subject = "Refinement",          StartTime = today.AddHours(9),  EndTime = today.AddHours(12),  IsAllDay = false, ProjectName = "PROJECT 2", CategoryName = "Steven" },
                new ResourceData { Id = 16, Subject = "Release Planning",    StartTime = today.AddHours(12), EndTime = today.AddHours(15),  IsAllDay = false, ProjectName = "PROJECT 2", CategoryName = "Nancy" },
                new ResourceData { Id = 17, Subject = "Customer Sync",       StartTime = today.AddHours(15), EndTime = today.AddHours(17),  IsAllDay = false, ProjectName = "PROJECT 2", CategoryName = "Steven" },
                new ResourceData { Id = 18, Subject = "Sprint Demo",         StartTime = today.AddHours(10), EndTime = today.AddHours(12),  IsAllDay = false, ProjectName = "PROJECT 2", CategoryName = "Nancy" },
                new ResourceData { Id = 19, Subject = "Backlog Grooming",     StartTime = today.AddHours(12), EndTime = today.AddHours(14),  IsAllDay = false, ProjectName = "PROJECT 2", CategoryName = "Steven" },
                new ResourceData { Id = 20, Subject = "Handoff",              StartTime = today.AddHours(14), EndTime = today.AddHours(16),  IsAllDay = false, ProjectName = "PROJECT 2", CategoryName = "Nancy" }
            };
        }

        public List<AppointmentData> GetWaitingListData()
        {
            DateTime today = DateTime.Now.Date;
            return new List<AppointmentData>
            {
                new AppointmentData { Id = 1,  Subject = "Echocardiogram",        StartTime = today.AddHours(8),  EndTime = today.AddHours(9),  IsAllDay = false, Department = "GENERAL", Consultant = "Alice" },
                new AppointmentData { Id = 2,  Subject = "Dental Checkup",        StartTime = today.AddHours(9),  EndTime = today.AddHours(10), IsAllDay = false, Department = "DENTAL",  Consultant = "Nancy" },
                new AppointmentData { Id = 3,  Subject = "Eye Exam",              StartTime = today.AddHours(10), EndTime = today.AddHours(11), IsAllDay = false, Department = "GENERAL", Consultant = "Alice" },
                new AppointmentData { Id = 4,  Subject = "Blood Test",            StartTime = today.AddHours(11), EndTime = today.AddHours(12), IsAllDay = false, Department = "GENERAL", Consultant = "Nancy" },
                new AppointmentData { Id = 5,  Subject = "Root Canal",            StartTime = today.AddHours(12), EndTime = today.AddHours(14), IsAllDay = false, Department = "DENTAL",  Consultant = "Alice" },
                new AppointmentData { Id = 6,  Subject = "Vaccination",           StartTime = today.AddHours(14), EndTime = today.AddHours(15), IsAllDay = false, Department = "GENERAL", Consultant = "Nancy" },
                new AppointmentData { Id = 7,  Subject = "Follow-up",             StartTime = today.AddHours(15), EndTime = today.AddHours(16), IsAllDay = false, Department = "GENERAL", Consultant = "Alice" },
                new AppointmentData { Id = 8,  Subject = "Cleaning",              StartTime = today.AddHours(16), EndTime = today.AddHours(17), IsAllDay = false, Department = "DENTAL",  Consultant = "Nancy" },
                new AppointmentData { Id = 9,  Subject = "Consultation",          StartTime = today.AddHours(17), EndTime = today.AddHours(18), IsAllDay = false, Department = "GENERAL", Consultant = "Alice" },
                new AppointmentData { Id = 10, Subject = "X-Ray",                 StartTime = today.AddHours(18), EndTime = today.AddHours(19), IsAllDay = false, Department = "DENTAL",  Consultant = "Nancy" }
            };
        }

        public List<AppointmentData> GetHospitalData()
        {
            DateTime today = DateTime.Now.Date;
            return new List<AppointmentData>
            {
                new AppointmentData { Id = 11, Subject = "Surgery",            StartTime = today.AddHours(8),  EndTime = today.AddHours(11), IsAllDay = false, Department = "GENERAL", Consultant = "Alice" },
                new AppointmentData { Id = 12, Subject = "Consultation",      StartTime = today.AddHours(11), EndTime = today.AddHours(13), IsAllDay = false, Department = "DENTAL",  Consultant = "Nancy" },
                new AppointmentData { Id = 13, Subject = "Lab",               StartTime = today.AddHours(13), EndTime = today.AddHours(15), IsAllDay = false, Department = "GENERAL", Consultant = "Alice" },
                new AppointmentData { Id = 14, Subject = "Therapy",           StartTime = today.AddHours(15), EndTime = today.AddHours(17), IsAllDay = false, Department = "GENERAL", Consultant = "Nancy" },
                new AppointmentData { Id = 15, Subject = "Orthodontics",      StartTime = today.AddHours(9),  EndTime = today.AddHours(12), IsAllDay = false, Department = "DENTAL",  Consultant = "Alice" },
                new AppointmentData { Id = 16, Subject = "Checkup",           StartTime = today.AddHours(12), EndTime = today.AddHours(14), IsAllDay = false, Department = "GENERAL", Consultant = "Nancy" },
                new AppointmentData { Id = 17, Subject = "Procedure",         StartTime = today.AddHours(14), EndTime = today.AddHours(16), IsAllDay = false, Department = "DENTAL",  Consultant = "Alice" },
                new AppointmentData { Id = 18, Subject = "Recovery",          StartTime = today.AddHours(16), EndTime = today.AddHours(18), IsAllDay = false, Department = "GENERAL", Consultant = "Nancy" },
                new AppointmentData { Id = 19, Subject = "Suture Removal",    StartTime = today.AddHours(10), EndTime = today.AddHours(11), IsAllDay = false, Department = "DENTAL",  Consultant = "Alice" },
                new AppointmentData { Id = 20, Subject = "Discharge",         StartTime = today.AddHours(11), EndTime = today.AddHours(12), IsAllDay = false, Department = "GENERAL", Consultant = "Nancy" }
            };
        }

        public List<AppointmentData> GetRecurrenceData()
        {
            DateTime today = DateTime.Now.Date;
            return new List<AppointmentData>
            {
                new AppointmentData { Id = 21, Subject = "Daily Standup",  StartTime = today.AddHours(9),  EndTime = today.AddHours(10), IsAllDay = false },
                new AppointmentData { Id = 22, Subject = "Weekly Sync",    StartTime = today.AddDays(1).AddHours(11), EndTime = today.AddDays(1).AddHours(12), IsAllDay = false },
                new AppointmentData { Id = 23, Subject = "Monthly Review", StartTime = today.AddDays(7).AddHours(13), EndTime = today.AddDays(7).AddHours(14), IsAllDay = false },
                new AppointmentData { Id = 24, Subject = "Quarterly Plan", StartTime = today.AddDays(30).AddHours(15), EndTime = today.AddDays(30).AddHours(17), IsAllDay = false },
                new AppointmentData { Id = 25, Subject = "Daily Code Review", StartTime = today.AddDays(1).AddHours(14), EndTime = today.AddDays(1).AddHours(15), IsAllDay = false },
                new AppointmentData { Id = 26, Subject = "Bi-weekly Retrospective", StartTime = today.AddDays(14).AddHours(16), EndTime = today.AddDays(14).AddHours(17), IsAllDay = false },
                new AppointmentData { Id = 27, Subject = "Daily Backlog", StartTime = today.AddDays(2).AddHours(10), EndTime = today.AddDays(2).AddHours(11), IsAllDay = false },
                new AppointmentData { Id = 28, Subject = "Weekly Demo",   StartTime = today.AddDays(5).AddHours(15), EndTime = today.AddDays(5).AddHours(16), IsAllDay = false },
                new AppointmentData { Id = 29, Subject = "Daily Testing", StartTime = today.AddDays(3).AddHours(13), EndTime = today.AddDays(3).AddHours(14), IsAllDay = false },
                new AppointmentData { Id = 30, Subject = "Monthly Demo",  StartTime = today.AddDays(45).AddHours(11), EndTime = today.AddDays(45).AddHours(12), IsAllDay = false }
            };
        }
    }
}

namespace EJ2MVCSampleBrowser.Controllers.Schedule
{
    public partial class ScheduleController : Controller
    {
        public ActionResult ExternalDragDrop()
        {
            ViewData["treeDataSource"] = new ScheduleData().GetWaitingListData();
            ViewData["datasource"] = new ScheduleData().GetHospitalData();

            List<ResourceDataSourceModel> departments = new List<ResourceDataSourceModel>();
            departments.Add(new ResourceDataSourceModel { text = "GENERAL", id = 1, color = "#bbdc00" });
            departments.Add(new ResourceDataSourceModel { text = "DENTAL", id = 2, color = "#9e5fff" });
            ViewData["Departments"] = departments;

            List<ConsultantDataSourceModel> consultants = new List<ConsultantDataSourceModel>();
            consultants.Add(new ConsultantDataSourceModel { text = "Alice", id = 1, groupId = 1, color = "#bbdc00", designation = "Cardiologist" });
            consultants.Add(new ConsultantDataSourceModel { text = "Nancy", id = 2, groupId = 2, color = "#9e5fff", designation = "Orthodontist" });
            ViewData["Consultants"] = consultants;

            ViewData["Resources"] = new string[] { "Departments", "Consultants" };
            return View("~/Views/Home/scheduler/external-drag-and-drop/Scheduler.cshtml");
        }
    }
}
```
