New to Telerik UI for ASP.NET CoreStart a free 30-day trial

Initialize the Grid in a TabStrip

Environment

ProductTelerik UI for ASP.NET Core Grid and Telerik UI for ASP.NET Core TabStrip
Progress Telerik UI for ASP.NET Core versionCreated with the 2024.2.514 version

Description

How can I display the Grid component in a specified tab of a TabStrip?

By design, when the Grid is initialized inside a hidden container, its layout may not be resized correctly. For example, when the Grid is integrated into the TabStrip component, the Grid initializes when the respective tab activates. For more information, refer to the Grid in hidden containers article.

Solution

You can apply the same approach when integrating the Grid into a PanelBar or Window components, which also act as hidden containers for the Grid.

  1. Handle the Activate event of the TabStrip.

  2. Get a reference to the Grid and call the resize() method when the Grid becomes visible.

    Razor
        @(Html.Kendo().TabStrip()
            .Name("tabStrip")
            .Events(e => e.Activate("onActivate"))
            ... // Other configuration.
        )

For a runnable example based on the code above, refer to the following REPL samples:

More ASP.NET Core Grid Resources

See Also