AutoFitColumn Javascript function on grid not working if the display style property is none during page load. Column width is minimum.

0 Answers 18 Views
Grid TabStrip
ConcretePlusGrass
Top achievements
Rank 1
ConcretePlusGrass asked on 10 Jan 2025, 01:01 PM

I am using autoFitColumn function on a Telerik UI for MVC grid to show the content of all cells as per the below article.

https://docs.telerik.com/aspnet-mvc/knowledge-base/grid-autofit-all-columns-width

This works if the grid's display is not none. However, there are three tabs on the page, each containing a grid. Only the opened grid has correct column widths. Other grids have minimum column widths. This is unless the user manually opens each tab quickly during data load.

I tried using Telerik's TabStrip at first, but the grid always has minimum column widths when using autoFitColumns, even on the first tab. The goal was to put a Grid inside each tab of the TabStrip. Currently, I am using custom built tabs. 

My current solution to this problem is to set the "hidden" style of each grid to:

position: absolute;
top: -9999px;
left: -9999px;

Is there a better solution?

No answers yet. Maybe you can help?

Tags
Grid TabStrip
Asked by
ConcretePlusGrass
Top achievements
Rank 1
Share this question
or