Skip to main content
A newer version of this page is available. .

StyleFormatConditionBase.Expression Property

Gets or sets the Boolean expression. When it evaluates to true, the StyleFormatConditionBase.Appearance is applied to data. The Expression property is in effect when the StyleFormatConditionBase.Condition property is set to FormatConditionEnum.Expression.

Namespace: DevExpress.XtraEditors

Assembly: DevExpress.XtraEditors.v19.2.dll

Declaration

[DefaultValue("")]
[XtraSerializableProperty]
public string Expression { get; set; }

Property Value

Type Default Description
String String.Empty

A string that specifies the Boolean expression.

Example

The following example shows how to create a condition to style grid rows, and specify criteria for the condition using a string expression.

The condition’s criteria is specified by the StyleFormatConditionBase.Expression property. The expression selects rows that do not contain null in the Region field. Rows that match this condition will be painted in light pink.

The following image shows this condition applied to an XtraGrid control.

StyleCondition_Expression_ex

using DevExpress.XtraGrid;

StyleFormatCondition condition1 = new DevExpress.XtraGrid.StyleFormatCondition();
condition1.Appearance.BackColor = Color.SeaShell;
condition1.Appearance.Options.UseBackColor = true;
condition1.Condition = FormatConditionEnum.Expression;
condition1.Expression = "[Region] != ?";
gridView1.FormatConditions.Add(condition1);

The following code snippets (auto-collected from DevExpress Examples) contain references 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