Simplexcel icon indicating copy to clipboard operation
Simplexcel copied to clipboard

Implicitly create cell

Open mstum opened this issue 12 years ago • 2 comments

When i want to do

sheet.Cells["B2"].Bold = true;

this throws a NullReferenceException because the B2 Cell isn't created yet. CellCollection should implicitly create an empty cell.

Two problems: What if I then assign a Cell to B2? Since Cell is created implicitly, CellCollection doesn't have a good way to know if the Cell came from a Cell object or from an implicit creation.

Also, Cell.CellType is immutable. I forgot why, since it only matters on save, so I might change that.

mstum avatar Jan 10 '13 10:01 mstum

This would require separating the Cell Content, and the Cell Formatting into two separate classes. The CellContent would contain the CellType, Value, and Format, while the CellFormat would include the Font, Border etc.

mstum avatar Sep 18 '17 00:09 mstum

Maybe doing this in 3.0, where I might break a few things for a better API.

mstum avatar Sep 18 '17 00:09 mstum

https://github.com/mstum/Simplexcel/issues/43

mstum avatar Aug 25 '22 13:08 mstum