Skip to main content

CalculatedField.Expression Property

Specifies the expression of the current calculated field.

Namespace: DevExpress.Snap.Core.API

Assembly: DevExpress.Snap.v21.2.Core.dll

NuGet Package: DevExpress.Snap.Core

Declaration

public string Expression { get; set; }

Property Value

Type Description
String

A String value.

Remarks

Use the Expression property to specify the expression for the calculated field. In the Snap project, this property provides access to the Expression Editor.

Snap_ExpressionEditor

For expressions, numerous date-time, logical, math and string functions, operators and constants are supported. For a complete list of these functions, refer to Expressions.

To refer to a data field (returned by the CalculatedField.DataSource and CalculatedField.DataMember properties) within an expression, enclose its name in [square brackets]. Parameters are inserted using the “Parameters.” prefix before their names.

Date-time constants must be wrapped in #hashes# ([OrderDate] >= #1/1/2009#). To represent a null reference (one that does not refer to any object), use a question mark ([Region] != ?). And, to denote strings, use apostrophes, otherwise, an error occurs.

The type of value returned by a calculated field is defined by its CalculatedField.FieldType property.

A calculated field’s expression cannot evaluate the values of other calculated fields.

The following code snippet (auto-collected from DevExpress Examples) contains a reference to the Expression property.

Note

The algorithm used to collect these code examples remains a work in progress. Accordingly, the links and snippets below may produce inaccurate results. If you encounter an issue with code examples below, please use the feedback form on this page to report the issue.

See Also