Page Index Toggle Pages: 1 Send TopicPrint
Normal Topic Column Auto Width Filling to Largest Entry Size (Read 2088 times)
MindFusionUser47
YaBB Newbies
*
Offline


I Love MindFusion!

Posts: 9
Location: Illinois
Joined: Jan 23rd, 2018
Column Auto Width Filling to Largest Entry Size
Jan 23rd, 2018 at 6:56pm
Print Post  
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.
  
Back to top
 
IP Logged
 
Meppy
God Member
*****
Offline


MindFusion support

Posts: 1783
Joined: Jul 20th, 2005
Re: Column Auto Width Filling to Largest Entry Size
Reply #1 - Jan 24th, 2018 at 7:58am
Print Post  
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
  
Back to top
 
IP Logged
 
Page Index Toggle Pages: 1
Send TopicPrint