How to display a fixed tabstip content height?

1 Answer 222 Views
TabStrip
Francis
Top achievements
Rank 1
Iron
Iron
Iron
Francis asked on 31 Jan 2022, 06:24 PM
I need to have a fixed tabstip content body instead of collapsing based on the content size. Like minimum height or fixed height with scrollbars on overflow.

1 Answer, 1 is accepted

Sort by
0
Alexander
Telerik team
answered on 03 Feb 2022, 12:05 PM

Hi Francis,

In general, the TabStrip content containers are scrollable by default if the . Hence, this allows the widget to display scroll bars based on whether it has a fixed height or holds large content that cannot fit.

Having this in mind, you can set the fixed height of the content by using one of the following approaches:

    @(Html.Kendo().TabStrip()
          .Name("tabstrip")
          ...
          .Items(tabstrip =>
          {
              tabstrip.Add().Text("Paris")
                  .Selected(true)
                  .Content(@<text>
                    <div class="weather">
                        <h2>17<span>&ordm;C</span></h2>
                        <p>Rainy weather in Paris.</p>
                    </div>
                    <span class="rainy">&nbsp;</span>
                  </text>).ContentHtmlAttributes(new {style="height:50px"});

          })
    )
  • By adjusting the CSS styles of the "k-content" class generated by Kendo. Note that this approach will apply the heigh to all TabStrip contents respectively. You can review this Telerik REPL example for a visual illustration:
    #tabstrip > .k-content{
        height:200px;
    }

Personally, I would go with the first approach, as it gives more control over the stylization of a particular Tabstrip item.

I hope you find this helpful. If any further questions arise do not hesitate to ask.

Regards,
Alexander
Progress Telerik

Love the Telerik and Kendo UI products and believe more people should try them? Invite a fellow developer to become a Progress customer and each of you can get a $50 Amazon gift voucher.

Francis
Top achievements
Rank 1
Iron
Iron
Iron
commented on 03 Feb 2022, 01:53 PM

I agree the first approach is better. Thanks, Alexander
Tags
TabStrip
Asked by
Francis
Top achievements
Rank 1
Iron
Iron
Iron
Answers by
Alexander
Telerik team
Share this question
or