Posted 18 February 2022, 3:20 am EST - Updated 30 September 2022, 4:14 am EST
I’m working with a Fspread Item but I were unable to set the width of a column based on a range of the cells.
On that column got a cell that contains a long text But i do not want the column to get the width of that cell since on an other rows I got a text that context a normal size text and I want the column to resize to those row text and not to the one with the long text. Example:
I got this:
And I want to give it the range that Auto Fit the cells in the range of StartRow=3, StartColum = 1, EndRow = 7, EndColumn = 2,
So it looks like this:
But when I use:
fpSpread1.AcrtiveSheet.Columns[1].Width = fpSpread.ActiveSheet.Columns[1].GetPreferredWidth();
pSpread1.AcrtiveSheet.Columns[2].Width = fpSpread.ActiveSheet.Columns[2].GetPreferredWidth();
This Happens where it takes in to account the cell 1,1 like this:
Is there any solution to this? That doesn’t involve doing this:
Since for big sheets it down crease the performance a lot by doing GetPreferredCellSize for each cell in the range.