Back to Devexpress

TdxSpreadSheetConditionalFormattingRuleExpression.Expression2 Property

vcl-dxspreadsheetconditionalformattingrules-dot-tdxspreadsheetconditionalformattingruleexpression-dot-expression2.md

latest4.2 KB
Original Source

TdxSpreadSheetConditionalFormattingRuleExpression.Expression2 Property

Specifies a value or formula expression used as an additional cell formatting criterion for a Cell Is conditional formatting rule.

Declaration

delphi
property Expression2: string index 1 read; write;

Property Value

TypeDescription
stringAssigned ValueThe required formula expression string or a value.Returned ValueThe formula expression’s source text string or an empty string if a parse error has occurred.

Remarks

Use the Expression2 property to define additional formatting criteria for a cell range or data item when a Cell Is conditional formatting rule is in effect.

An expression or value assigned to the Expression2 property is evaluated only if the rule’s ComparisonOperator property is set to cicoBetween[1] or cicoNotBetween.

Expression Syntax

In Spreadsheet and Report Designer controls, formula expressions follow the same syntax as in Microsoft Excel®, and formula operands can refer to individual cells and cell ranges.

Data Item References in Container Controls

In Data Grid, Vertical Grid, and Tree List, you can use the same built-in functions available in Spreadsheet and Report Designer controls. However, formula expressions can refer only to data items[2] rather than individual cells or arbitrary cell ranges.

To refer to a data item in a formula expression, you can use the data item’s caption enclosed in square brackets:

=[Sales]>AVERAGE([Sales],)*1.2

If you use a data-aware grid View, Vertical Grid, or Tree List control, you can also refer to the corresponding dataset field by its name enclosed in curly brackets:

={fieldSales}>AVERAGE({fieldSales},)*1.2

Note

Only the TdxSpreadSheetConditionalFormattingRuleCellIs class publishes the Expression2 property. This property is not available at the TdxSpreadSheetConditionalFormattingRuleExpression class level.

Default Value

The Expression2 property’s default value is an empty string.

Footnotes

  1. The ComparisonOperator property’s default value.

  2. A data item corresponds to an individual field of the underlying dataset. Different container controls display data items in a different manner:

See Also

TdxSpreadSheetConditionalFormattingRuleExpression.Expression Property

TdxSpreadSheetConditionalFormattingRuleExpression Class

TdxSpreadSheetConditionalFormattingRuleExpression Members

dxSpreadSheetConditionalFormattingRules Unit