New to Telerik Document Processing? Start a free 30-day trial

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

Expression trees support at most 2,048 total levels and 256 nested non-binary constructs, including the leaf expression. Constructing a deeper tree throws NestingDepthExceededException before recursive processing. Binary operators consume total depth only; functions, unary, implicit intersection and spill operators also consume nesting depth. On x64 threads requesting a 1 MiB stack, Release100 (net10.0-windows) and Release462 (net462) completed guarded array-capability, string/XLSX serialization, translation and clone traversals of 2,048-level addition trees; constructing 2,049 levels hit the numeric cap. This compatibility ceiling is not an overflow threshold. Stack probes can reject other traversal patterns or smaller stacks earlier. Evaluation supports at most 8,192 simultaneously computing expressions, including dependencies in other cells. Every frame beyond 16 also probes remaining execution stack. On x64 threads requesting a 1 MiB stack, seven cold 5,000-cell reference/running-total patterns reached catchable stack probes at 584-2,786 active expression frames in Release100 (net10.0-windows), and 601-1,704 in Release462 (net462). A 2,048-level addition tree evaluated on Release100; Release462 completed 2,000 levels, while the 2,048-level tree reached its probe at 2,027 active expression frames. These are guarded observations, not overflow thresholds. The 8,192 compatibility ceiling permits ordinary dependency chains on larger stacks without lowering the construction ceiling; smaller stacks still fail catchably earlier.

Definition

Namespace:Telerik.Documents.Spreadsheet.Expressions

Assembly:Telerik.Windows.Documents.Spreadsheet.dll

Syntax:

C#
public abstract class RadExpression

Inheritance: objectRadExpression

Derived Classes: AnchorArrayExpressionCellReferenceRangeExpressionConstantExpressionFunctionExpressionOperatorExpressionSingleExpressionSpreadsheetNameExpression...

Constructors

Initializes a new expression with an unknown evaluation state.

C#
protected RadExpression()

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.

Events

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

C#
public event EventHandler ValueInvalidated

Extension Methods