Edit this page

Initialize the Grid

The example below demonstrates how to use the activate event when initializing the Grid within the PanelBar so as it is resized according to the dimensions of its container.

Important In addition to the Kendo UI PanelBar, this example can be applied to the TabStrip and Window widgets, which, too, act as hidden containers for the Grid.

      <button id="openBtn">Open</button>

      <ul id="panelbar">
        <li id="item1">Item 1
          <div id="grid"></div>
        <li id="item2">Item 2
            <li>Sub Item 1</li>
            <li>Sub Item 2</li>
            <li>Sub Item 3</li>

      <script src="https://demos.telerik.com/kendo-ui/content/shared/js/products.js"></script>
        var panelbar = $("#panelbar").kendoPanelBar().data("kendoPanelBar");

        var grid = $("#grid").kendoGrid({
            dataSource: {
              data: products,
              pageSize: 5
          height: 200,
          scrollable: true,
          columns: [
              { field: "UnitPrice", title: "Unit Price", format: "{0:c}", width: "130px" },
              { field: "UnitsInStock", title: "Units In Stock", width: "130px" },
              { field: "Discontinued", width: "130px" }

          //apply the activate event, which is thrown only after the animation is played out
          panelbar.one("activate", function() {

          $("#openBtn").click(function(e) {

See Also

Other articles on the Kendo UI PanelBar:

For more runnable examples on the Kendo UI PanelBar widget, browse its How To documentation folder.

Is this article helpful? Yes / No
Thank you for your feedback!

Give article feedback

Tell us how we can improve this article