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. (Last updated on: November 16, 2018).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

Make each column the width of the widest cell?

Thread ID:





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

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 01:18 PM UTC

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.

Please sign in to access our forum

This page will automatically be redirected to the sign-in page in 10 seconds.

Warning Icon 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.Close Icon