# Gantt for ASP.NET MVC Initialized in Container Does Not Render Properly

## Environment

<table>
 <tr>
  <td>Product</td>
  <td>Progress® Telerik® UI Gantt for ASP.NET MVC</td>
 </tr>
</table>

## Description

My Gantt chart is placed in PanelBar item content that is not initially visible. When activating this item, the Gantt does not render properly.

## Cause

The Gantt was initialized in a hidden (`display: none;`) container.

## Solutions

1. Use [the deferred initialization](https://docs.telerik.com/aspnet-mvc/getting-started/fundamentals#configuration-Deferring) of the Gantt.

   ```C#
   @(Html.Kendo().Gantt<InPanelBar.Models.TaskViewModel, InPanelBar.Models.DependencyViewModel>()
   .Name("Gantt")
   ...
   .Deferred()
   )
   ```
2. Initialize the widget on the first [`activate`](https://docs.telerik.com/kendo-ui/api/ui/panelbar/events/activate) event of the PanelBarItem that contains it.

   ```JavaScript
   function onActivate(e) {
       var item = e.item;
       var title = $(item).find('a.k-header').text();
       var gantt = $('#Gantt').getKendoGantt();

       if (title === "Add Contenuti" && !gantt) {
           @Html.Kendo().DeferredScriptsFor("Gantt", false);
       }
   }
   ```

## See Also

* [API Reference of the Gantt](https://docs.telerik.com/kendo-ui/api/ui/gantt)
