Hi Stheve
Thank you for contacting Syncfusion support
Query: Is there any property to set or method to run in order to fit all columns by once?
We have checked your code snippet, fitWidth method is used to fit the width of columns in the Spreadsheet. We can achieve this in the button click. Please find the below code snippet.
function btnClick(e) {
var xlObj = $("#Spreadsheet").data("ejSpreadsheet"), xlFormat = xlObj.XLFormat;
if (!xlObj.isImport) {
xlObj.setWidthToColumns([140, 128, 105, 100, 100, 110, 120, 120, 100]);
}
for (var j = 0; j < xlObj.model.sheets.length; j++) {
for (var i = 0; i < xlObj.model.sheets[j].colCount; i++) {
xlObj.XLResize.fitWidth([i]); // To fit the columns
}
}
} |
For your convenience we have prepared a sample. Please find the below sample link:
Please find the below Documentation link:
Could you please check the above sample and get back to us if you need further assistance on this?
Regards,
Saranya D