Skip to main content

IndicatorFormatConditionBase.SelectiveExpression Property

Gets or sets an expression that selects data records to which a conditional format is applied. This is a dependency property.

Namespace: DevExpress.Xpf.Grid

Assembly: DevExpress.Xpf.Grid.v23.2.Core.dll

NuGet Package: DevExpress.Wpf.Grid.Core


public string SelectiveExpression { get; set; }

Property Value

Type Description

A String value that is the rule expression.


Use the SelectiveExpression property to apply conditional formatting to specific cells based on an expression.

The code sample below illustrates how to define a conditional format that is applied to cells which values meet the specified SelectiveExpression in markup.

   <dxg:IconSetFormatCondition Expression="Abs([NewPrice] - [OldPrice])" FieldName="OldPrice" SelectiveExpression="[NewPrice] > 500" PredefinedFormatName="TrafficLights3UnrimmedIconSet"/>

The code sample below illustrates how to define the same conditional format in code-behind.

var priceFormatCondition = new IconSetFormatCondition() {
   Expression = "Abs([NewPrice] - [OldPrice])",
   FieldName = "OldPrice",
   SelectiveExpression = "[NewPrice] > 500",
   PredefinedFormatName = "TrafficLights3UnrimmedIconSet"
See Also