Search results

Restrict collapsing of records when clicking on Gantt chart rows in ASP.NET Core Gantt control

15 Oct 2021 / 1 minute to read

Restriction of collapsing the records when clicking on gantt chart rows can be performed by using the collapsing event.

tagHelper
restrictcollapsechartrows.cs
Copied to clipboard
<ejs-gantt id='Gantt' dataSource="ViewBag.dataSource" height="450px">
                    <e-gantt-taskfields id="TaskId" name="TaskName" startDate="StartDate" endDate="EndDate" duration="Duration" collapsing="collapsing" progress="Progress" child="SubTasks">
                    </e-gantt-taskfields>
                    <e-gantt-editsettings allowAdding="true" allowEditing="true"></e-gantt-editsettings>
                </ejs-gantt>
				
				<script>
				   function contextMenuOpen(args) {
                       var gantt = document.getElementById("Gantt").ej2_instances[0];
                       if (gantt.ganttChartModule.isExpandCollapseFromChart) {
                           args.cancel = true;
                           }
                        }
               </script>
Copied to clipboard
public IActionResult Index()
{
    ViewBag.DataSource = GanttData.ProjectNewData();
    return View();
}