We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy.
Unfortunately, activation email could not send to your email. Please try again.

Make each column the width of the widest cell?

Thread ID:





131753 Jul 25,2017 05:04 PM Jul 26,2017 09:18 AM ASP.NET Core 1
Tags: Spreadsheet
Jacob Knight
Asked On July 25, 2017 05:04 PM

I'm trying to see if there are any <e-sheet(s)> settings that dynamically set the width of ever cell in a column based off the width of the widest text loaded into any cells in that column? Or maybe there's a global setting for this?

Silambarasan I [Syncfusion]
Replied On July 26, 2017 09:18 AM

Hi Jacob, 
Thank you for using Syncfusion products. 
We have checked your requirement and it has been achieved by using ‘fitWidth()’ client-side method in Spreadsheet. And, currently we don’t have any global setting for achieve the auto fit to width based on column text content.  Please refer the below code example. 
JS Playground Sample link: http://jsplayground.syncfusion.com/wlbj2iiv 
var dataSource = [ 
    sheets: [{ 
        rangeSettings: [{ dataSource: dataSource }] 
    loadComplete: "onLoadComplete" 
function onLoadComplete (args){ 
    if (!this.isImport){ 
        this.XLResize.fitWidth([0,1]); // Column index 
Could you please check the above sample and let us know whether is this fulfilling your requirement, if not please share us more information regarding this so that we can analyze based on that and provide you a better solution. The information provided would be great help for us to proceed further. 


This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.