New to Telerik Document ProcessingStart a free 30-day trial

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:

C#
public abstract class CellValueBase<T> : ICellValue

Inheritance: objectCellValueBase<T>

Derived Classes: BooleanCellValueEmptyCellValueErrorCellValueFormulaCellValueNumberCellValueTextCellValue...

Implements: ICellValue

Constructors

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

C#
protected CellValueBase(T value)
Parameters:valueT

The value.

Methods

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

C#
public override bool Equals(object obj)
Parameters:objobject

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)

Serves as a hash function for a particular type.

C#
public override int GetHashCode()
Returns:

int

A hash code for the current object.

Overrides: object.GetHashCode()

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

C#
public virtual string GetResultValueAsString(CellValueFormat format)
Parameters:formatCellValueFormat

The format.

Returns:

string

Implements: ICellValue.GetResultValueAsString(CellValueFormat)

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

C#
public string GetValueAsString(CellValueFormat format)
Parameters:formatCellValueFormat

The format.

Returns:

string

Implements: ICellValue.GetValueAsString(CellValueFormat)

Gets the value as string override.

C#
protected virtual string GetValueAsStringOverride(CellValueFormat format = null)
Parameters:formatCellValueFormat

The format.

Returns:

string

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

C#
public void InvalidateEditFormatString()

Properties

Gets the unformatted string representation of the stored value.

C#
public virtual string RawValue { get; }
Property Value:

The raw value.

Implements: ICellValue.RawValue

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

C#
public virtual CellValueType ResultValueType { get; }
Property Value:

The type of the result value.

Implements: ICellValue.ResultValueType

Gets the strongly-typed value stored in the cell.

C#
public T Value { get; }
Property Value:

The value.

Gets the type of the value.

C#
public abstract CellValueType ValueType { get; }
Property Value:

The type of the value.

Implements: ICellValue.ValueType