Class Cell
- Namespace
- FileFormat.Cells
- Assembly
- FileFormat.Cells.dll
public sealed class Cell
- Inheritance
-
Cell
- Inherited Members
Constructors
Cell(Cell, SheetData, WorkbookPart)
Initializes a new instance of the Cell class.
public Cell(Cell cell, SheetData sheetData, WorkbookPart workbookPart)
Parameters
cell
CellThe underlying OpenXML cell object.
sheetData
SheetDataThe sheet data containing the cell.
workbookPart
WorkbookPart
Exceptions
- ArgumentNullException
Thrown when
cell
orsheetData
is null.
Properties
CellReference
Gets the cell reference in A1 notation.
public string CellReference { get; }
Property Value
Methods
ApplyStyle(uint)
Applies a style to the cell.
public void ApplyStyle(uint styleIndex)
Parameters
styleIndex
uintThe index of the style to apply.
GetDataType()
Gets the data type of the cell's value.
public CellValues? GetDataType()
Returns
- CellValues?
The cell's value data type, or null if not set.
GetFormula()
Gets the formula set for the cell.
public string GetFormula()
Returns
- string
The cell's formula as a string, or null if not set.
GetValue()
Gets the value of the cell.
public string GetValue()
Returns
- string
The cell value as a string.
PutFormula(string)
Sets a formula for the cell.
public void PutFormula(string formula)
Parameters
formula
stringThe formula to set.
PutValue(DateTime)
Sets the value of the cell as a date.
public void PutValue(DateTime value)
Parameters
value
DateTimeThe date value to set.
PutValue(double)
Sets the value of the cell as a number.
public void PutValue(double value)
Parameters
value
doubleThe numeric value to set.
PutValue(string)
Sets the value of the cell as a string.
public void PutValue(string value)
Parameters
value
stringThe value to set.