StyleFormatConditionBase.Condition Property

Gets or sets the comparison operation used by the style condition object.

Namespace: DevExpress.XtraEditors

Assembly: DevExpress.XtraEditors.v20.1.dll

Declaration

[DefaultValue(FormatConditionEnum.None)]
[XtraSerializableProperty]
public FormatConditionEnum Condition { get; set; }
<DefaultValue(FormatConditionEnum.None)>
<XtraSerializableProperty>
Public Property Condition As FormatConditionEnum

Property Value

Type Default Description
FormatConditionEnum

None

A FormatConditionEnum enumeration value which specifies the comparison operation.

Examples

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);
See Also