A newer version of this page is available. Switch to the current version.

Expressions

  • 2 minutes to read

Specific DevExpress controls allow various criteria to be specified as string expressions. For instance, GridControl and PivotGridControl controls allow expressions to be used to implement unbound (calculated) columns. Data for these columns is calculated automatically according to the specified formula. In addition, expressions can be used to represent criteria for conditional format rules. See the information below to learn more.

Overview

An expression is a string that, when parsed and processed, evaluates some value. Expressions consist of column/field names, constants, operators, and functions. Column/field names must be wrapped with brackets. To learn more about available operators and functions, see below. The following are examples of regular expressions.

"[Quantity] * [UnitPrice] * (1 - [BonusAmount])"

"[FirstName] + ' ' + [LastName]"

Boolean expressions:

"[Country] == 'USA'"

"[OrderDate] > #8/16/1994# AND [Quantity] > 20"

NOTE

Expressions for unbound columns/fields can evaluate values of any type. Expressions used to create style conditions represent conditions, so they must evaluate Boolean values.

When specifying expressions in code, columns/fields are referred to by their field names. They are wrapped in square brackets. However, expressions can also be customized via the Expression Editor (at design time or by an end-user at runtime). In the Expression Editor, columns/fields are represented by their display captions, also wrapped in brackets. When closing the Expression Editor, the display captions are automatically converted to corresponding field names.

Concepts

Member Tables