Skip to main content

.NET Core Excel Column Autofit - Community / GemBox.Spreadsheet Feature Request - GemBox Support Center

Please re-add the functionality for auto fit that was removed for the .NET Standard 2.0 version.

Comments (8)

Alan Churchill
This is a very important add, IMO.
Stu Campbell
Yes, please support this. We can't use it without autofit.
Mario - GemBox
Hi,

We have recently released a GemBox.Spreadsheet for .NET Core 3.0 which does support AutoFit methods on Windows.
Currently, there is no cross-platform support.

To use it in desktop applications you'll need to use "Microsoft.NET.Sdk.WindowsDesktop" SDK and set "UseWPF" property to "true".
To use it in web application you'll need to add framework reference for "Microsoft.WindowsDesktop.App".

Also, if your cells contains single font then perhaps you could create some approximation that would be based on text length and font size.
For instance, you could calculate the average widths of some characters, like numbers, lower case letters and upper case letters and use that to auto fit the content.
Additionally, you could perhaps handle separately the characters that have narrow font glyphs (for example those are typically letters 'i', 'I', 'j', etc.) and wide font glyphs ('O', 'W', etc.).

Hopefully, that would provide you decent accuracy for your requirement.


Regards,

Mario
GemBox d.o.o.
Alan Churchill
Mario,

Thanks for tackling this issue knowing how hard it is. If GemBox was to support it for most of the common fonts (Arial, Tahoma, Courier, Calibri, etc.) it would satisfy most needs. Perhaps with an overload for adjustment (ex. AutoFit(decimal pctAdjust).

For now, I am fine with Windows only. WinForm and WPF support is also Windows Core only so that is a safe approach that covers most scenarios.

My opinion, of course.

Thanks for everything.
Mario - GemBox
Hi,

Support for AutoFit in .NET Core on Windows has been implemented and is available in latest versions of GemBox.Spreadsheet for .NET 3.0.
Because most of these requests where for .NET Core on Windows, we'll mark this request as "Completed".

Regards,

Mario
GemBox d.o.o.
Alan Churchill
Mario, any chance you can eliminate the Windows.Form dependence? I need this for a class library and that dependency seems unnecessary.
Alan Churchill
To be clear, I can understand why it was there but just asking if it is possible to remove it in the near term.
Mario - GemBox
Hi,

Please try using the GemBox.Spreadsheet for .NET Standard.
It doesn't have that dependency.

Regards,

Mario
GemBox d.o.o.