Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Named Range: the cell's DataValidation got changed from "List" to "AnyValue" after calling InsertTable #2259

Open
2 of 6 tasks
tdave3000 opened this issue Jan 15, 2024 · 0 comments

Comments

@tdave3000
Copy link

tdave3000 commented Jan 15, 2024

Read and complete the full issue template

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

  • Bug
  • Feature
  • Question

Did you test against the latest CI build?

  • Yes
  • No

Version of ClosedXML

0.102.2

What is the current behavior?
Previously defined DataValidation gets changed after calling the following method:
ClosedXML.Excel.IXLCell :
IXLTable InsertTable(IEnumerable data, string tableName, bool createTable);

AllowedValues = "List" ===> this is being changed to "AnyValue"
Value = [my named range] ===> this is being changed to ""
Ranges = {Entities!H2:H1048576} ===> this is being changed to {Entities!H3:H3}

What is the expected behavior?

Previously defined DataValidation should be kept as is, after calling the InsertTable method.
AllowedValues should continue to be "List"
Value should continue to be [my named range]
Ranges should continue to be {Entities!H2:H1048576}

Is this a regression from the previous version?
Unknown

Reproducibility

DataValidation got changed from "List" to "AnyValue" (see debugging screen prints attached)

before calling InsertTable:
AllowedValues = List,
Ranges = {Entities!H2:H1048576},
Values = rngEntityTypes (named Range)

after calling InsertTable:
AllowedValues = AnyValue,
Ranges = {Entities!H2:H3},
Values = ""

Code to reproduce problem:

public void Main()
{
var table = worksheet.Cell(startCell.Address).InsertTable(contentList, "MyTable", false);
}
  • I attached a sample spreadsheet. (You can drag files on to this issue)
    before calling "InsertTable":
    before InsertTable
    after calling "InsertTable":
    after insertTable
@tdave3000 tdave3000 changed the title the cell's DataValidation got changed from "List" to "AnyValue" after calling InsertTable Named Range: the cell's DataValidation got changed from "List" to "AnyValue" after calling InsertTable Jan 15, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant