Skip to main content

Expressions Overview

DevExpress data aware controls allow various criteria to be specified as string expressions. For example, the Data Grid control allows expressions to be used to implement unbound (calculated) columns. Data for these columns is calculated automatically, according to a specified formula. In addition, expressions can be used to represent criteria for style conditions.

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, thus 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.

See Also