Rendering the Gantt control using GanttProperties in server-side
29 Mar 2018 / 2 minutes to read
The GanttProperties
helps to render the Gantt control in server-side.
The following code example explains how to render the Gantt control in server-side.
@(Html.EJ().Gantt("GanttControl", ViewBag.GanttModel))
namespace Gantt_MVC.Controllers
{
public class GanttController : Controller
{
public ActionResult Gantt()
{
GanttProperties gantt = new GanttProperties();
gantt.TaskIdMapping = "TaskID";
gantt.TaskNameMapping = "TaskName";
gantt.StartDateMapping = "StartDate";
gantt.DurationMapping = "Duration";
gantt.ProgressMapping = "Progress";
gantt.ScheduleStartDate = "02/01/2017";
gantt.ScheduleEndDate = "03/14/2017";
gantt.ChildMapping = "SubTasks";
gantt.PredecessorMapping = "Predecessors";
gantt.TreeColumnIndex = 1;
gantt.SizeSettings.Width = "750px";
gantt.SizeSettings.Height = "350px";
gantt.DataSource = GetTaskData();
ViewBag.GanttModel = gantt;
return View();
}
}
}
The below screenshot shows the output of above code example.
Was this page helpful?
Yes
No
Thank you for your feedback!
Thank you for your feedback and comments. We will rectify this as soon as possible!
An unknown error has occurred. Please try again.
Help us improve this page