# in html xyz.commponent.tz
<tabset #staticTabs>
<tab heading="User">
<ag-grid-angular
style="width: 100%; height: 500px;"
class="ag-theme-material"
[rowData]="rowData"
[columnDefs]="columnDefs"
[gridOptions]="gridOptions"
>
</ag-grid-angular>
</tab>
<tab heading="Whitelisted User" >
<ag-grid-angular
style="width: 100%; height: 500px;"
class="ag-theme-material"
[rowData]="rowData1"
[columnDefs]="columnDefs1"
[gridOptions]="gridOptions"
>
</ag-grid-angular>
</tab>
<tab heading="Blacklisted User">
<ag-grid-angular
style="width: 100%; height: 500px;"
class="ag-theme-material"
[rowData]="rowData2"
[columnDefs]="columnDefs2"
[gridOptions]="gridOptions"
>
</ag-grid-angular>
</tab>
</tabset>
#in xyz.component.ts
constructor() {
this.gridOptions = {
onGridReady: () => {
this.gridOptions.api.sizeColumnsToFit();
},
};}
I want to resize all 3 ag-grid but no one is resized. it gives no error in the console but shows this ag-Grid: tried to call sizeColumnsToFit() but the grid is coming back with zero width, maybe the grid is not visible yet on the screen?