Articles in this section
Category / Section

How to render Gantt fit to the browser window in .NET MVC application?

1 min read

By using “SizeSettings” API we can able to fit the Gantt to the browser window.

By default, the Gantt control size will be updated according to “SizeSettings” and “IsResponsive” property values when we resize the window.

When we assign width or height value in percentage Gantt control size will be updated as per parent element size.

Please refer following code snippet,

CSHTML

<style type="text/css">
html, body {
height: 100%;
padding: 0px;
margin: 0px;
}             
#GanttContainer {
position: absolute;
}
</style>
<body>
@(Html.EJ().Gantt("GanttContainer")
//..
 
.SizeSettings(ss =>
{
ss.Width("100%");
ss.Height("100%");
})
.Datasource(ViewBag.datasource)
 
)
</body>

The Gantt control with 100% height and width is available in following link.

Link: http://mvc.syncfusion.com/demos/web/Projecttracker/Projecttracker/Index

 

Conclusion

I hope you enjoyed learning about How to render Gantt fit to the browser window in .NET MVC application.

You can refer to our .NET MVC Gantt feature tour page to know about its other groundbreaking feature representations and documentation, and how to quickly get started for configuration specifications. You can also explore our .NET MVC Gantt example to understand how to create and manipulate data.

For current customers, you can check out our components from the License and Downloads page. If you are new to Syncfusion, you can try our 30-day free trial to check out our other controls.

If you have any queries or require clarifications, please let us know in the comments section below. You can also contact us through our support forumsDirect-Trac, or feedback portal. We are always happy to assist you!

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