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
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

How to drag and drop records from Grid to the Schedule control ?

Platform: ASP.NET MVC |
Control: Schedule

How to drag and drop records from Grid to the Schedule control and vice versa?


The following steps helps you to drag and drop records from Grid to the Schedule control and vice versa

Step 1:  Create an MVC application and include the default Schedule and Grid control in it by referring the following links,

Schedule: http://mvc.syncfusion.com/demos/web/schedule/default

Grid: http://mvc.syncfusion.com/demos/web/grid/default

Step 2: Define the DragStop event for Scheduler and RowDrop event for Grid with appropriate handler. 





        .CurrentDate(new DateTime(2015, 9, 12))

        .ScheduleClientSideEvents(evt =>


            .AppointmentSettings(fields => fields














            .RowDropSettings(drop => drop.DropTargetID("#Schedule1"))

            .ClientSideEvents(eve => eve.RowDrop("rowDropHandler"))

                .EditSettings(edit => { edit.AllowAdding().AllowDeleting().AllowEditing(); })




Step 3: onDragStop and rowDropHandler is a function within which the code to drag and drop appointment/record from Schedule and Grid are defined as shown in the below code example,

    function rowDropHandler(args) { // this event function will be called when the record is drag and dropped from Grid

        var object = $("#Schedule1").data("ejSchedule"); // here object for Schedule is created

        object.saveAppointment(args.data[0]); // here we are passing the record to the public save function to render in Schedule

        var gridObject = $("#OrdersGrid").data("ejGrid"); // here object for Grid is created

        gridObject.deleteRecord("Id", args.data[0]); // here we are deleting the drag and dropped appointment from Grid



function onDragStop(args) {// drag and drop an appointment to other control 

        if (args.event != undefined) {

            var scheobj = $("#Schedule1").data("ejSchedule");

            if ($(args.event.target).hasClass('e-rowcell')) {

                $("#OrdersGrid").ejGrid("addRecord", { Id: args.appointment.Id, Subject: args.appointment.Subject, AllDay: args.appointment.AllDay, EndTime: args.appointment.EndTime, StartTime: args.appointment.StartTime, Recurrence: args.appointment.Recurrence, RecurrenceRule: args.appointment.RecurrenceRule });


                ($(document.body).find(".e-scheduleAppGlassy").length > 0) && $(document.body).find(".e-scheduleAppGlassy").remove();





Step 4: Run the sample and now you can drag and drop the appointments from Schedule to Grid and vice versa as shown in the below images,


Record is drag and dropped to Schedule from Grid

Figure 1: Record is drag and dropped to Schedule from Grid.

Appointment is drag and dropped to Grid from Schedule

Figure 2: Appointment is drag and dropped to Grid from Schedule.

MVC Sample: http://www.syncfusion.com/downloads/support/directtrac/156882/ze/Schedulewith_grid-1953899562.zip


2X faster development

The ultimate ASP.NET MVC UI toolkit to boost your development speed.
You must log in to leave a comment

Please sign in to access our KB

This page will automatically be redirected to the sign-in page in 10 seconds.

Up arrow icon

Warning Icon You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.Close Icon

Live Chat Icon For mobile