New to Telerik Document ProcessingStart a free 30-day trial

Extension methods for RadExpression that provide convenient value extraction, type conversion, and validation operations for use throughout formula evaluation.

Definition

Namespace:Telerik.Windows.Documents.Spreadsheet.Expressions

Assembly:Telerik.Windows.Documents.Spreadsheet.dll

Syntax:

C#
public static class ExpressionExtensions

Inheritance: objectExpressionExtensions

Methods

Evaluates the expression and returns its value as a constant, extracting the first element if the result is an array.

C#
public static ConstantExpression GetValueAsConstantExpression(this RadExpression expression)
Parameters:expressionRadExpression

The expression.

Returns:

ConstantExpression

The ConstantExpression result.

Extracts the integer value from a numeric expression, throwing an exception if the expression is not a NumberExpression.

C#
public static int IntegerValue(this RadExpression expression)
Parameters:expressionRadExpression

The expression.

Returns:

int

The value as integer.

Exceptions:

ArgumentNullException

Thrown when expression is not NumberExpression.

Tests whether a character is valid within a function name or cell reference during formula parsing.

C#
public static bool IsValidFunctionOrCellReferenceNamePart(this char character)
Parameters:characterchar

The character.

Returns:

bool

True if valid, otherwise false.

Extracts the numeric value from an expression, returning 0 if the expression is not a NumberExpression.

C#
public static double NumberValue(this RadExpression expression)
Parameters:expressionRadExpression

The expression.

Returns:

double

The number value as double. If the expression is not NumberExpression returns 0.

Converts a Boolean value to the corresponding BooleanExpression singleton (True or False).

C#
public static BooleanExpression ToBooleanExpression(this bool value)
Parameters:valuebool

The value.

Returns:

BooleanExpression

The result as BooleanExpression.

Converts a CellReferenceRange to the equivalent CellRange with resolved row and column indexes.

C#
public static CellRange ToCellRange(this CellReferenceRange cellReferenceRange)
Parameters:cellReferenceRangeCellReferenceRange

The cell reference range.

Returns:

CellRange

The cell range.