[Expand]General Information
[Expand]WinForms Controls
[Expand]ASP.NET Controls and MVC Extensions
[Expand]ASP.NET Bootstrap Controls
[Expand]ASP.NET Core Bootstrap Controls
[Collapse]WPF Controls
 [Expand]What's Installed
 [Collapse]Common Concepts
  [Expand]Printing and Exporting
  [Expand]Saving and Restoring Layouts
   Typed Styles
  [Expand]Touch Support
    Expressions Overview
    Expression Editor
    Expression Editor Capabilities
    Invoking Expression Editor
    Expression Editor Modes
    Expression Editor Customization
  [Expand]Formatting Values
   Prism Adapters
  [Expand]Data Sources
  [Expand]Performance Improvement
   XAML Namespaces
 [Expand]MVVM Framework
 [Expand]Controls and Libraries
 [Expand]Scaffolding Wizard
  Redistribution and Deployment
  Get More Help
 [Expand]API Reference
[Expand]Xamarin Controls
[Expand]Windows 10 App Controls
[Expand]Office File API
[Expand]Report and Dashboard Server
[Expand]eXpressApp Framework
[Expand]eXpress Persistent Objects
[Expand]CodeRush Classic
[Expand]Cross-Platform Core Libraries
[Expand]Tools and Utilities
 End-User Documentation
View this topic on docs.devexpress.com (Learn more)

Expressions Overview

An expression is a string that, after parsing and processing, returns a value. Expressions consist of column/field names, operators, functions, and constants. See the following examples of expressions:

  • "[Quantity] * [UnitPrice] * (1 - [BonusAmount])"
  • "[FirstName] + ' ' + [LastName]"
  • "[Country] == 'USA'"
  • "[OrderDate] > #8/16/1994# AND [Quantity] > 20"

Expressions for Unbound Columns/fields can evaluate values of any type. Expressions that represent criteria for conditional formatting rules have to evaluate boolean values.

You can use the Expression Editor to create or edit expressions.

Expanded Syntax Rules

Follow the syntax conventions below when creating or editing expressions:

  • Enclose data field names in square brackets (for example, [Products.ProductName]).
  • Type a question mark before Query Parameters names (for example, ?parameter1).

    Add the "Parameters" prefix before report parameters names (for example, [Parameters.parameter1]).

  • Enclose string values in apostrophes (for example, 'USA'). An attempt to use quotes instead results in an error.

    Type a double apostrophe to embed an apostrophe into an expression's text (for example, 'It''s sample text').

  • Enclose date-time constants in hashtags (for example, [OrderDate] >= #1/1/2016#).
  • Use a question mark to represent a null reference (one that does not refer to any object) (for example, [Region] != ?).
  • If an expression uses different types, you can convert them to the same type using dedicated functions (for example, Max(ToDecimal([Quantity]),[UnitPrice])).

Refer to the Criteria Language Syntax topic to learn more.

Is this topic helpful?​​​​​​​