Skip to content

AdjustToContents doesn't take into account Excel filter icon. #2519

Open
@AIO1

Description

@AIO1

Read and complete the full issue template

Do not randomly delete sections. They are here for a reason.

Do you want to request a feature or report a bug?

  • Bug
  • Feature
  • Question

Did you test against the latest CI build?

  • Yes
  • No

If you answered No, please test with the latest development build first.

Version of ClosedXML
0.104.2

What is the current behavior?
If you set an auto filter on a row, the "AdjustToContents" won't take into account the filter arrow horizontal size as a normal excel would do:
image

What is the expected behavior or new feature?
A normal Excel file when adjusting contents would look like this:
image

It takes into account the dimension of the filter icon.

Is this a regression from the previous version?
No regressión.

Reproducibility

Code to reproduce problem:

worksheet.Range("A1:D1").SetAutoFilter();
worksheet.Columns().AdjustToContents();
  • I attached a sample spreadsheet. (You can drag files on to this issue)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions