- Welcome, Guest. Please Login or Register
MindFusion  
  We are soon releasing MindFusion.JavaScript pack. Initial version includes chart, diagram, calendar, map, virtual keyboard, gauge and UI components. Here are the beta version and live demo for anyone interested.  
  HomeHelpSearchLoginRegister   
     
     
   
 
Page Index Toggle Pages: 1 Send Topic Print  
Column Auto Width Filling to Largest Entry Size
Read 387 times

MindFusionUser47   Offline
YaBB Newbies
*
Posts: 7
Gender: male
Illinois
I Love MindFusion!


   
     
 
Column Auto Width Filling to Largest Entry Size
Jan 23rd, 2018 at 6:56pm
 
What is the most elegant way to have the column width for each column be the size of the largest entry so no resizing is needed upon program runtime? Is there any built in feature that allows auto-sizing? If not I would recommend one in the new features forum. Any solutions please? Already I have tried measuring the size of the biggest string in each column by means of loops. Then trying to convert string length to pt which is very difficult as not all chars are the same length. Then setting the sheet.Columns[x].Width = xpt for each x columns. There has to be a better way? Hopefully a built in one.
 
 
 
IP Logged    
 
     

Meppy   Offline
YaBB Moderator
*****
Posts: 1783
Gender: male
MindFusion support


   
     
 
Re: Column Auto Width Filling to Largest Entry Size
Reply #1 - Jan 24th, 2018 at 7:58am
 
Hi,

You can use the ResizeColumnToFit or ResizeColumnsToFit methods in the WorkbookView class to resize one or multiple columns to fit their content.

I hope this helps.

Regards,
Meppy
 
 
 
IP Logged    
 
     
Page Index Toggle Pages: 1 Send Topic Print