New to Telerik Document ProcessingStart a free 30-day trial

Abstract base for all spreadsheet expressions, providing lazy evaluation, change propagation, and value caching for formula calculation.

Definition

Namespace:Telerik.Windows.Documents.Spreadsheet.Expressions

Assembly:Telerik.Windows.Documents.Spreadsheet.dll

Syntax:

C#
public abstract class RadExpression

Inheritance: objectRadExpression

Derived Classes: CellReferenceRangeExpressionConstantExpressionFunctionExpressionOperatorExpressionSpreadsheetNameExpression

Constructors

Initializes a new expression with an unknown evaluation state.

C#
protected RadExpression()

Events

Raised when the expression's cached value becomes invalid and requires recalculation.

C#
public event EventHandler ValueInvalidated

Methods

Called only by the factory to register this expression with the workbook.

C#
protected void FinishRegistration(Workbook workbook)
Parameters:workbookWorkbook

Evaluates and returns the computed value, detecting cyclic references during calculation.

C#
public RadExpression GetValue()
Returns:

RadExpression

The value as RadExpression.

Evaluates the expression and returns the result formatted as a string.

C#
public string GetValueAsString()
Returns:

string

The value as string.

Evaluates the expression and returns the result formatted according to the specified culture.

C#
public string GetValueAsString(CultureInfo cultureInfo)
Parameters:cultureInfoCultureInfo

The culture info.

Returns:

string

The value as string.

Calculates the expression result; override to define specific evaluation logic for each expression type.

C#
protected abstract RadExpression GetValueOverride()
Returns:

RadExpression

The value as RadExpression.

Marks the cached value as invalid, triggering recalculation on next access and propagating invalidation to dependent expressions.

C#
protected void InvalidateValue()

Determines whether the current instance is registered in the calculation map of the workbook.

C#
protected virtual bool IsRegistered()
Returns:

bool

true if the instance is registered; otherwise, false.

Raises the ValueInvalidated event to notify dependent expressions.

C#
protected virtual void OnValueInvalidated()

Converts the expression to its formula string representation using default culture.

C#
public override string ToString()
Returns:

string

A string that represents the current object.

Overrides: object.ToString()

Converts the expression to its formula string representation using the specified culture for number and list separators.

C#
public string ToString(CultureInfo cultureInfo)
Parameters:cultureInfoCultureInfo

The culture info.

Returns:

string

The expression as string.

Extension Methods