Class
CellValueBase<T>

Abstract base for strongly-typed cell value implementations, managing value storage, formatting, and string conversion.

Definition

Namespace:Telerik.Windows.Documents.Spreadsheet.Model

Assembly:Telerik.Windows.Documents.Spreadsheet.dll

Type Parameters:

T

The type of the underlying value.

Syntax:

cs-api-definition
public abstract class CellValueBase<T> : ICellValue

Inheritance: objectCellValueBase<T>

Derived Classes: BooleanCellValueEmptyCellValueErrorCellValueFormulaCellValueNumberCellValueTextCellValue

Implements: ICellValue

Constructors

CellValueBase(T)

Initializes a new instance of the CellValueBase<T> class.

Declaration

cs-api-definition
protected CellValueBase(T value)

Parameters

value

T

The value.

Properties

RawValue

Gets the unformatted string representation of the stored value.

Declaration

cs-api-definition
public virtual string RawValue { get; }

Property Value

string

The raw value.

Implements ICellValue.RawValue

ResultValueType

Gets the evaluated value type after formula calculation; same as ValueType for non-formula values.

Declaration

cs-api-definition
public virtual CellValueType ResultValueType { get; }

Property Value

CellValueType

The type of the result value.

Implements ICellValue.ResultValueType

Value

Gets the strongly-typed value stored in the cell.

Declaration

cs-api-definition
public T Value { get; }

Property Value

T

The value.

ValueType

Gets the type of the value.

Declaration

cs-api-definition
public abstract CellValueType ValueType { get; }

Property Value

CellValueType

The type of the value.

Implements ICellValue.ValueType

Methods

Equals(object)

Determines whether the specified object is equal to the current object.

Declaration

cs-api-definition
public override bool Equals(object obj)

Parameters

obj

object

The object to compare with the current object.

Returns

bool

True if the specified object is equal to the current object; otherwise, false.

Overrides object.Equals(object)

GetHashCode()

Serves as a hash function for a particular type.

Declaration

cs-api-definition
public override int GetHashCode()

Returns

int

A hash code for the current object.

Overrides object.GetHashCode()

GetResultValueAsString(CellValueFormat)

Converts the evaluated result value to a formatted string for display.

Declaration

cs-api-definition
public virtual string GetResultValueAsString(CellValueFormat format)

Parameters

format

CellValueFormat

The format.

Returns

string

Implements ICellValue.GetResultValueAsString(CellValueFormat)

GetValueAsString(CellValueFormat)

Converts the cell value to a string using the specified format, caching the result for performance.

Declaration

cs-api-definition
public string GetValueAsString(CellValueFormat format)

Parameters

format

CellValueFormat

The format.

Returns

string

Implements ICellValue.GetValueAsString(CellValueFormat)

GetValueAsStringOverride(CellValueFormat)

Gets the value as string override.

Declaration

cs-api-definition
protected virtual string GetValueAsStringOverride(CellValueFormat format = null)

Parameters

format

CellValueFormat

The format.

Returns

string

InvalidateEditFormatString()

Clears the cached string representation, forcing it to be recalculated on next access.

Declaration

cs-api-definition
public void InvalidateEditFormatString()