Splitting and Merging Tasks in ASP.NET MVC Gantt Chart

Splitting task at load time

To split a task at load time, define segment details in both hierarchical and self-referential ways. Refer below link for more details.

Split task dynamically

The task can be split dynamically, either using the context menu or dialog.

@Html.EJS().Gantt("Gantt").DataSource((IEnumerable<object>)ViewBag.DataSource).Height("450px").Toolbar(new List<string>() 
  { "Add", "Cancel", "CollapseAll", "Delete", "Edit", "ExpandAll", "Search", "Update" }).TaskFields(ts => ts.Id("TaskId").Name(
                "TaskName").StartDate("StartDate").EndDate("EndDate").Duration("Duration").Progress("Progress").Child("SubTasks").Segments("Segments")
                ).EnableContextMenu(true).EditSettings(es=>
                es.AllowEditing(true).AllowAdding(true).AllowDeleting(true).AllowTaskbarEditing(true)).Render()
public ActionResult SplitTasks()
        {
            ViewBag.DataSource = GanttData.SplitTasksData();
            return View();
        }

Alt text

Alt text

Alt text

Alt text

Merge tasks

The split tasks can be merged either using the Merge Task item of the Context menu or using the dialog. Merge the tasks by dragging the segments together in the UI.

Limitations of Split tasks

  1. Parent and milestone tasks cannot be split into segments.
  2. The task must have a width greater than the timeline unit cell to be split.
  3. Split task is not supported with Multi taskbar.