Articles in this section
Category / Section

How to update the dimensions for ASP.NET MVC Gantt at run time?

1 min read

In Gantt control, the dimensions of the Gantt chart can be changed using the sizeSettings.height and sizeSettings.width properties. The height and width values can be provided in both pixels and percentage values.

To update the dimensions of the Gantt during run time, the following code snippets can be used.

<button id="resizeGantt" style="display:block">Resize Gantt</button>
.SizeSettings(st =>
//Updating the height and width of Gantt through button click
$("#resizeGantt").click(function () {
var ganttObj = $("#GanttSample").data("ejGantt");
if (ganttObj.model.sizeSettings.height == "450px")
ganttObj.setModel({ "sizeSettings": { height: "300px", width: "70%" } });
ganttObj.setModel({ "sizeSettings": { height: "450px", width: "100%" } });

Sample link

A sample for updating the dimensions of Gantt chart is available in the following link. Sample



Did you find this information helpful?
Help us improve this page
Please provide feedback or comments
Comments (0)
Please sign in to leave a comment