Open bokrma opened 4 months ago
It would be helpful to know what you have in mind. Changing the way the Data Validations are stored would be quite difficult. But I'm guessing that you want to emulate Excel's Data Validation "Apply these changes to all other cells with the same settings". If that is the case, a less difficult solution presents itself. You would need two new methods - one which returns a list of all cells with the same Data Validation as a given cell, and another which copies a Data Validation to a list of cells. Then you could do something like:
$cellList = $sheet->getIdenticalDataValidationList($targetCell);
// apply changes to $targetCell->dataValidation
$sheet->copyDataValidation($targetCell, $cellList);
Would that satisfy your requirement?
I will try it out, thank you!
Solving this may have a lot in common with a solution, if any, for #797. I'm going to think about it for a while.
Currently in the functionality there is only way to set validation per cell public function setDataValidation(string $cellCoordinate, ?DataValidation $dataValidation = null): static and the get also return the range as parts: $this->worksheet->getDataValidationCollection();
can we let it return as defined in the excel file: and also set as range instead of cell by cell