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.v24.1.dll
NuGet Package: DevExpress.Win.Navigation
Declaration
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.
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);