Grid autoSizeColumns not working for multiple tabs

Posted by: saisreeja.gadi on 11 July 2023, 4:07 pm EST

    • Post Options:
    • Link

    Posted 11 July 2023, 4:07 pm EST - Updated 11 July 2023, 4:12 pm EST

    Hi

    My application contains multiple tabs, each tab contains grid.

    I am trying to add **autoSizeColumns() ** Its not working for me. I need to apply autoSizeColumns for all the grids in multiple tabs. Can you please help me on this.

    In my code **autoSizeColumns() ** working for the grid present in first tab only. It’s not working for the grids that are present in other tabs

  • 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

  • Posted 12 July 2023, 8:18 pm EST

    Hi vivek,

    Thank you. Its working for me.

Need extra support?

Upgrade your support plan and get personal unlimited phone support with our customer engagement team

Learn More

Forum Channels