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
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