Skip to main content

DevExpress v24.2 Update — Your Feedback Matters

Our What's New in v24.2 webpage includes product-specific surveys. Your response to our survey questions will help us measure product satisfaction for features released in this major update and help us refine our plans for our next major release.

Take the survey Not interested

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.v24.2.Core.dll

NuGet Package: DevExpress.Wpf.Grid.Core

#Declaration

public string SelectiveExpression { get; set; }

#Property Value

Type Description
String

A String value that is the rule expression.

#Remarks

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:TableView.FormatConditions>
   <dxg:IconSetFormatCondition Expression="Abs([NewPrice] - [OldPrice])" FieldName="OldPrice" SelectiveExpression="[NewPrice] > 500" PredefinedFormatName="TrafficLights3UnrimmedIconSet"/>
</dxg:TableView.FormatConditions>

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"
};
view.FormatConditions.Add(priceFormatCondition);
See Also