Search results

Change Schedule Dates in ASP.NET MVC Gantt control

20 Jan 2022 / 1 minute to read

In the Gantt control, you can change the schedule start and end dates by clicking the custom button programmatically using the updateProjectDates method. You can pass the start and end dates as method arguments to the updateProjectDates method. You can also pass the Boolean value as an additional parameter, which is used to round-off the schedule start and end dates displayed in Gantt timeline.

Copied to clipboard
@Html.EJS().Button("updateSchedule").Content("Update Schedule").CssClass("e-primary").Render()
        @Html.EJS().Gantt("Gantt").DataSource((IEnumerable<object>)ViewBag.DataSource).Height("450px").TaskFields(ts =>
          document.getElementById("updateSchedule").addEventListener('click', () => {
             var ganttObj = document.getElementById("Gantt").ej2_instances[0];
             ganttObj.updateProjectDates(new Date('01/10/2019'), new Date('06/20/2019'), true);
Copied to clipboard
public IActionResult Index()
    ViewBag.DataSource = GanttData.ProjectNewData();
    return View();