{
  "$schema": "https://ai.syncfusion.com/schema/registry-item.json",
  "name": "gantt-default-editing",
  "framework": "aspnet-core",
  "type": "registry:component",
  "component": "Gantt",
  "variant": "default-editing",
  "dependencies": [
    "Syncfusion.AspNetCore.Gantt"
  ],
  "description": "Gantt chart supports task editing, dependencies, custom dialog fields, and task markers.",
  "meta": {
    "essentialStudioRelease": "2026 Volume 2 (v34.1.29)",
    "license": "commercial-or-community",
    "licenseNote": "The Syncfusion package is licensed. The composition in this file is source you own and edit. See https://ai.syncfusion.com/licensing.md",
    "requiresLicenseKey": true,
    "requiresServerEndpoint": false,
    "platformIndex": "https://ai.syncfusion.com/aspnet-core/llms.txt",
    "skillPack": "syncfusion/aspnetcore-ui-components-skills",
    "docs": "https://ai.syncfusion.com/gallery/aspnet-core/gantt-default-editing.md"
  },
  "files": [
    {
      "target": "src/components/gantt-default-editing/gantt.cshtml",
      "content": "@page\r\n@using EJ2CoreSampleBrowser.Models;\r\n\r\n<div class=\"control-section\">\r\n    <div class=\"row\">\r\n        <div class=\"col-md-12\">\r\n            <ejs-gantt id='Editing' dataSource=\"@GanttData.EditingData()\" gridLines=\"Both\" treeColumnIndex=\"1\"\r\n                       created=\"created\" actionBegin=\"actionBegin\" height=\"100%\" rowHeight=\"46\" taskbarHeight=\"25\"\r\n                       allowSelection=\"true\" highlightWeekends=\"true\" resources=\"@GanttData.EditingResources()\"\r\n                       projectStartDate=\"03/26/2025\" projectEndDate=\"09/10/2025\" enableHover=\"true\"\r\n                       toolbar=\"@(new List<string>() { \"Add\", \"Edit\", \"Update\", \"Delete\", \"Cancel\", \"ExpandAll\", \"CollapseAll\", \"Indent\", \"Outdent\" })\">\r\n                <e-gantt-taskfields id=\"TaskId\" name=\"TaskName\" startDate=\"StartDate\" endDate=\"EndDate\"\r\n                                    duration=\"Duration\" progress=\"Progress\" dependency=\"Predecessor\" parentID=\"ParentID\" notes=\"Notes\"\r\n                                    resourceInfo=\"ResourceId\">\r\n                </e-gantt-taskfields>\r\n                <e-gantt-resourcefields id=\"ResourceId\" name=\"ResourceName\"></e-gantt-resourcefields>\r\n                <e-gantt-splittersettings columnIndex=\"3\"></e-gantt-splittersettings>\r\n                <e-gantt-columns>\r\n                    <e-gantt-column field=\"TaskId\" width=\"80\"></e-gantt-column>\r\n                    <e-gantt-column field=\"TaskName\" headerText=\"Job Name\" width=\"250\"\r\n                                    clipMode=\"EllipsisWithTooltip\"></e-gantt-column>\r\n                    <e-gantt-column field=\"StartDate\"></e-gantt-column>\r\n                    <e-gantt-column field=\"EndDate\"></e-gantt-column>\r\n                    <e-gantt-column field=\"Duration\"></e-gantt-column>\r\n                    <e-gantt-column field=\"Progress\"></e-gantt-column>\r\n                    <e-gantt-column field=\"Predecessor\"></e-gantt-column>\r\n                </e-gantt-columns>\r\n                <e-gantt-editsettings allowAdding=\"true\" allowEditing=\"true\" allowDeleting=\"true\"\r\n                                      allowTaskbarEditing=\"true\" showDeleteConfirmDialog=\"true\"></e-gantt-editsettings>\r\n                <e-gantt-timelinesettings>\r\n                    <e-timelinesettings-toptier unit=\"Week\" format=\"MMM dd, y\"></e-timelinesettings-toptier>\r\n                    <e-timelinesettings-bottomtier unit=\"Day\"></e-timelinesettings-bottomtier>\r\n                </e-gantt-timelinesettings>\r\n                <e-gantt-labelSettings leftLabel=\"TaskName\" rightLabel=\"ResourceId\"></e-gantt-labelSettings>\r\n                <e-gantt-eventmarkers>\r\n                    <e-gantt-eventmarker day=\"4/17/2024\" label=\"Project approval and kick-off\"></e-gantt-eventmarker>\r\n                    <e-gantt-eventmarker day=\"5/3/2024\" label=\"Foundation inspection\"></e-gantt-eventmarker>\r\n                    <e-gantt-eventmarker day=\"6/7/2024\" label=\"Site manager inspection\"></e-gantt-eventmarker>\r\n                    <e-gantt-eventmarker day=\"7/16/2024\" label=\"Property handover and sign-off\"></e-gantt-eventmarker>\r\n                </e-gantt-eventmarkers>\r\n                <e-gantt-editdialogfields>\r\n                    <e-gantt-editdialogfield type=\"General\"></e-gantt-editdialogfield>\r\n                    <e-gantt-editdialogfield type=\"Dependency\"></e-gantt-editdialogfield>\r\n                    <e-gantt-editdialogfield type=\"Resources\"></e-gantt-editdialogfield>\r\n                    <e-gantt-editdialogfield type=\"Notes\"></e-gantt-editdialogfield>\r\n                </e-gantt-editdialogfields>\r\n            </ejs-gantt>\r\n        </div>\r\n    </div>\r\n</div>\r\n<script>\r\n    var startDate\r\n    function created(args) {\r\n        var gantt = document.getElementsByClassName('e-gantt')[0].ej2_instances[0];\r\n        gantt.treeGrid.grid.columns[1].validationRules = { required: true, minLength: [5, 'Task name should have a minimum length of 5 characters'] };\r\n        gantt.treeGrid.grid.columns[3].validationRules = { required: [customFn, 'Please enter a value greater than the start date.'] };\r\n        gantt.treeGrid.grid.columns[4].validationRules = { required: true };\r\n        gantt.treeGrid.grid.columns[5].validationRules = { required: true, min: 0, max: 100 };\r\n        gantt.enableHover = true;\r\n    }\r\n    function actionBegin(args) {\r\n        if (args.columnName === \"EndDate\" || args.requestType === \"beforeOpenAddDialog\" || args.requestType === \"beforeOpenEditDialog\") {\r\n            startDate = args.rowData.ganttProperties.startDate;\r\n        }\r\n        if (args.requestType === \"taskbarediting\" && args.taskBarEditAction === \"ChildDrag\") {\r\n            startDate = args.data.ganttProperties.startDate;\r\n        }\r\n    }\r\n    function customFn(args) {\r\n        var endDate;\r\n        var gantt = (document.getElementsByClassName('e-gantt')[0]).ej2_instances[0];\r\n        if (args.element && args.value) {\r\n            var dateOptions = { format: gantt.dateFormat, type: 'dateTime', skeleton: 'yMd' };\r\n            endDate = gantt.globalize.parseDate(args.value, dateOptions);\r\n            if (!startDate && gantt.editModule.dialogModule['beforeOpenArgs']) {\r\n                startDate = gantt.editModule.dialogModule['beforeOpenArgs'].rowData['ganttProperties'].startDate;\r\n                endDate = gantt.editModule.dialogModule['beforeOpenArgs'].rowData['ganttProperties'].endDate;\r\n            }\r\n            startDate.setHours(0, 0, 0, 0);\r\n            endDate.setHours(0, 0, 0, 0);\r\n        }\r\n        return startDate <= endDate;\r\n    }\r\n\r\n</script>"
    },
    {
      "target": "src/components/gantt-default-editing/gantt.cshtml.cs",
      "content": "using Microsoft.AspNetCore.Mvc.RazorPages;\r\n\r\nnamespace EJ2CoreSampleBrowser.Models;\r\n\r\npublic class GanttData : PageModel\r\n{\r\n    public static List<GanttDataSource> EditingData()\r\n    {\r\n        var GanttDataSourceCollection = new List<GanttDataSource>();\r\n\r\n        GanttDataSource Record1 = new GanttDataSource()\r\n        {\r\n            TaskId = 1,\r\n            TaskName = \"Planning and permits\",\r\n            StartDate = new DateTime(2025, 4, 2),\r\n            EndDate = new DateTime(2025, 4, 10),\r\n            Duration = 7,\r\n            Progress = 100,\r\n            ResourceId = new int[] { 1, 2, 3 }\r\n        };\r\n        GanttDataSource Record2 = new GanttDataSource()\r\n        {\r\n            TaskId = 2,\r\n            TaskName = \"Site evaluation\",\r\n            StartDate = new DateTime(2025, 4, 2),\r\n            EndDate = new DateTime(2025, 4, 4),\r\n            Duration = 2,\r\n            Progress = 100,\r\n            ParentID = 1,\r\n            ResourceId = new int[] { 1 }\r\n        };\r\n        GanttDataSource Record3 = new GanttDataSource()\r\n        {\r\n            TaskId = 3,\r\n            TaskName = \"Obtain permits\",\r\n            StartDate = new DateTime(2025, 4, 7),\r\n            EndDate = new DateTime(2025, 4, 9),\r\n            Duration = 3,\r\n            Progress = 100,\r\n            ParentID = 1,\r\n            Predecessor = \"2\",\r\n            ResourceId = new int[] { 2, 4 }\r\n        };\r\n        \r\n        GanttDataSourceCollection.Add(Record1);\r\n        GanttDataSourceCollection.Add(Record2);\r\n        GanttDataSourceCollection.Add(Record3);\r\n        return GanttDataSourceCollection;\r\n    }\r\n\r\n    public static List<GanttResources> EditingResources()\r\n    {\r\n        List<GanttResources> GanttResourcesCollection = new List<GanttResources>();\r\n\r\n        GanttResources Record1 = new GanttResources()\r\n        {\r\n            ResourceId = 1,\r\n            ResourceName = \"Martin Tamer\"\r\n        };\r\n        GanttResources Record2 = new GanttResources()\r\n        {\r\n            ResourceId = 2,\r\n            ResourceName = \"Rose Fuller\"\r\n        };\r\n        GanttResources Record3 = new GanttResources()\r\n        {\r\n            ResourceId = 3,\r\n            ResourceName = \"Margaret Buchanan\"\r\n        };\r\n\r\n        GanttResourcesCollection.Add(Record1);\r\n        GanttResourcesCollection.Add(Record2);\r\n        GanttResourcesCollection.Add(Record3);\r\n        return GanttResourcesCollection;\r\n    }\r\n}\r\npublic class GanttDataSource\r\n{\r\n    public int TaskId { get; set; }\r\n    public string TaskName { get; set; }\r\n    public DateTime? StartDate { get; set; }\r\n    public DateTime? EndDate { get; set; }\r\n    public int? Duration { get; set; }\r\n    public int Progress { get; set; }\r\n    public string Predecessor { get; set; }\r\n    public int[] ResourceId { get; set; }\r\n    public int? ParentID { get; set; }\r\n}\r\n\r\npublic class GanttResources\r\n{\r\n    public int ResourceId { get; set; }\r\n    public string ResourceName { get; set; }\r\n    public Nullable<int> Unit { get; set; }\r\n}"
    }
  ]
}