Dynamic size of tab content

1 Answer 57 Views
TabStrip
Ewald
Top achievements
Rank 1
Iron
Ewald asked on 01 Aug 2024, 11:35 PM

I have a Tabstrip with 3 tabs, and those tabs have content that has a dynamic size. Currently when the user selects the different tabs, the tab control will change in size because it is set its width and height to 100% (the size is not known at design time)

I would like to set the size of the tabstrip to the largest size of the dynamic content so that the tab control will remain the same size when the user selects the different tabs. 

How would I achieve that?

1 Answer, 1 is accepted

Sort by
0
Yanko
Telerik team
answered on 05 Aug 2024, 01:23 PM

Hello, Ewald,

You can set the TabStrip size to the size of the largest tab. You can achieve that by creating a div in which you display the content of the different tabs iterating through all of them and save the size of the biggest one in `tabSize`. Then you can use the `tabSize` to set the TabStrip dimensions. I prepared a demo that displays the above actions:

Please check the above demo and let me know if I can provide you with further assistance on the matter.

Regards,
Yanko
Progress Telerik

Do you have a stake in the designеr-developer collaboration process? If so, take our survey to share your perspective and become part of this global research. You’ll be among the first to know once the results are out.
-> Start The State of Designer-Developer Collaboration Survey 2024

Tags
TabStrip
Asked by
Ewald
Top achievements
Rank 1
Iron
Answers by
Yanko
Telerik team
Share this question
or