Search results

Set Scroll Top in ASP.NET Core Gantt control

20 Jan 2022 / 1 minute to read

In the Gantt control, you can set the vertical scroller position dynamically by clicking the custom button using the setScrollTop method.

Copied to clipboard
<ejs-button id="setScrollTop" content="Change Scroll Position" cssClass="e-primary"></ejs-button>
                <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">
        document.getElementById('setScrollTop').addEventListener('click', function (args) {
            var ganttObj = document.getElementById('Gantt').ej2_instances[0];
Copied to clipboard
public IActionResult Index()
    ViewBag.DataSource = GanttData.ProjectNewData();
    return View();

Alt text