Cell Class

Represents a cell in a spreadsheet.

Inheritance

Object

Documents.Spreadsheet.Cell

Namespace: Radzen.Documents.Spreadsheet

Assembly: Radzen.Blazor.dll

Syntax

public class Cell

Properties

Addresslink

Gets the address of the cell.

Declaration
public Documents.Spreadsheet.CellRef Address { get; }
Property Value
Type Description
Documents.Spreadsheet.CellRefGets the address of the cell.

Datalink

Gets the current value and its type as a CellData object.

Declaration
public Documents.Spreadsheet.CellData Data { get; }
Property Value
Type Description
Documents.Spreadsheet.CellDataGets the current value and its type as a CellData object.

Formatlink

Gets or sets the format of the cell.

Declaration
public Documents.Spreadsheet.Format Format { get; set; }
Property Value
Type Description
Documents.Spreadsheet.FormatGets or sets the format of the cell.

Formulalink

Gets or sets the formula of the cell.

Declaration
public string Formula { get; set; }
Property Value
Type Description
stringGets or sets the formula of the cell.

HasValidationErrorslink

Gets a value indicating whether the cell has validation errors.

Declaration
public bool HasValidationErrors { get; }
Property Value
Type Description
boolGets a value indicating whether the cell has validation errors.

IsEmptylink

Gets a value indicating whether this cell has no meaningful content (no value, formula, format, or hyperlink).

Declaration
public bool IsEmpty { get; }
Property Value
Type Description
boolGets a value indicating whether this cell has no meaningful content (no value, formula, format, or hyperlink).

QuotePrefixlink

Gets or sets a value indicating whether the cell value was entered with a leading apostrophe and should be treated as literal text even if it looks like a formula. Mirrors Excel's quotePrefix cell flag.

Declaration
public bool QuotePrefix { get; set; }
Property Value
Type Description
boolGets or sets a value indicating whether the cell value was entered with a leading apostrophe and should be treated as literal text even if it looks like a formula. Mirrors Excel's quotePrefix cell flag.

ValidationErrorslink

Gets the validation errors for the cell.

Declaration
public IReadOnlyList<string> ValidationErrors { get; }
Property Value
Type Description
IReadOnlyList<string>Gets the validation errors for the cell.

Valuelink

Gets or sets the value of the cell.

Declaration
public object Value { get; set; }
Property Value
Type Description
objectGets or sets the value of the cell.

ValueTypelink

Gets the type of value contained in the cell.

Declaration
public Documents.Spreadsheet.CellDataType ValueType { get; }
Property Value
Type Description
Documents.Spreadsheet.CellDataTypeGets the type of value contained in the cell.

Worksheetlink

Gets the sheet that contains this cell.

Declaration
public Documents.Spreadsheet.Worksheet Worksheet { get; }
Property Value
Type Description
Documents.Spreadsheet.WorksheetGets the sheet that contains this cell.

Methods

Clonelink

Clones the cell, creating a new instance with the same properties.

Declaration
public Documents.Spreadsheet.Cell Clone()
Returns

CopyFromlink

Copies the properties from another cell to this cell.

Declaration
public void CopyFrom(Documents.Spreadsheet.Cell other)
Parameters
Type Name Description
Documents.Spreadsheet.Cell other

GetValuelink

Gets the value of the cell as a string, or the formula if it exists.

Declaration
public string GetValue()
Returns
Type Description
string

GetValueAsStringlink

Gets the value of the cell as a string.

Declaration
public string GetValueAsString()
Returns
Type Description
string

SetValuelink

Sets the value of the cell based on a string input. A leading apostrophe escapes the value — the apostrophe is stripped, the remainder is stored as text, and QuotePrefix is set. Otherwise, a string starting with '=' is treated as a formula.

Declaration
public void SetValue(string value)
Parameters
Type Name Description
string value

Validatelink

Validates the cell's value against the sheet's validation rules.

Declaration
public void Validate()
An error has occurred. This app may no longer respond until reloaded. Reload 🗙