Posted 12 July 2023, 3:29 pm EST
Hi,
This question has already been answered on the following thread - https://www.grapecity.com/forums/wijmo/multiple-tabs-export-to-excel-and-pdf
Here’s a copy of the response -
The autoSizeColumns for the flexGrid won’t work until the grid cells are not rendered on the webpage, as the exact width cannot be measured until then. To avoid this issue, you can handle the ‘selectedIndexChanged’ event of the tab panel to autoSize the columns when the grid is visible.
Please refer to the following sample for a demonstration - https://jscodemine.grapecity.com/share/HLyZX9i4dECelXfwFjCw7w
Please note that in the above sample, I have handled the ‘loaded’ event of the ‘ODataCollectionView’ to initially auto-size the columns when data is loaded, this event (loaded) is not available in the normal CollectionView class.
In case, if you are not using ‘ODataCollectionView/RestCollectionView’ in your project, then you can handle the ‘loadedRows’ event of the flexGrid for the same purpose.
Regards