Autofit width of Columns

Hello,

Is there a way to autofit the width of columns to the data being brought in?

Thanks


1 Reply 1 reply marked as answer

GK Gayathri KarunaiAnandam Syncfusion Team February 9, 2021 11:02 AM UTC

Hi Austin, 
  
Thank you for contacting Syncfusion Support. 
 
We have checked your reported query. We can autofit the column using the autoFit method as demonstrated in the below code snippet 
 
Index.razor 
function createdHandler() { 
        //Applied style and number formatting to range of the active sheet 
        this.cellFormat({ fontWeight: 'bold', textAlign: 'center', verticalAlign: 'middle' }, 'A1:F1'); 
        this.numberFormat('$#,##0.00', 'F2:F31'); 
        this.autoFit("A:F") //To autofit the column 
    } 
 
For your reference, we have prepared a sample based on this scenario. Please check the below link. 


Please check the above link and get back to us, if you need further assistance. 

Regards, 
Gayathri K 


Marked as answer
Loader.
Up arrow icon