Skip to content

Commit c657dc2

Browse files
Fix AutoFit to handle all columns in range (#1150)
1 parent bef60be commit c657dc2

1 file changed

Lines changed: 8 additions & 3 deletions

File tree

dotnet/src/dotnetframework/GxExcel/GxExcelEPPlus.cs

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -627,9 +627,14 @@ public string Value
627627

628628
private void fitColumnWidth()
629629
{
630-
if (_fitColumnWith)
631-
pCellsRange.AutoFitColumns();
632-
}
630+
if (_fitColumnWith)
631+
{
632+
for (int columnIndex = pCellsRange.Start.Column; columnIndex <= pCellsRange.End.Column; columnIndex++)
633+
{
634+
pSelectedSheet.Column(columnIndex).AutoFit();
635+
}
636+
}
637+
}
633638

634639
public string Type
635640
{

0 commit comments

Comments
 (0)