Search results

Event Markers in ASP.NET Core Gantt control

01 Dec 2021 / 1 minute to read

The event markers in the Gantt control is used to highlight the important events in a project. Event markers can be initialized by using the EventMarkers property, and you can define date and label for the event markers using the Day and Label properties. You can also customize it using the CssClass properties. The following code example shows how to add event markers in the Gantt control.

tagHelper
eventmarkers.cs
Copied to clipboard
<style>
      .e-gantt .e-gantt-chart .e-custom-event-marker {
          width: 1px;
          border-left: 2px green dotted;
        }
    </style>
	
	<ejs-gantt id='Gantt' dataSource="ViewBag.dataSource" height="450px">
        <e-gantt-taskfields id="TaskId" name="TaskName" startDate="StartDate"
                endDate="EndDate" duration="Duration" progress="Progress" child="SubTasks">
        </e-gantt-taskfields>
        <e-gantt-eventmarkers>
            <e-gantt-eventmarker day="04/10/2019" label="Project approval and kick-off" cssClass="e-custom-event-marker"></e-gantt-eventmarker>
        </e-gantt-eventmarkers>
    </ejs-gantt>
Copied to clipboard
public IActionResult Index()
{
    ViewBag.DataSource = GanttData.ProjectNewData();
    return View();
}

Alt text