wpf-devexpress-dot-xpf-dot-grid-dot-indicatorformatconditionbase-3de9600b.md
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.v25.2.Core.dll
NuGet Package : DevExpress.Wpf.Grid.Core
public string SelectiveExpression { get; set; }
Public Property SelectiveExpression As String
| Type | Description |
|---|---|
| String |
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: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);
Dim priceFormatCondition = New IconSetFormatCondition() With {
.Expression = "Abs([NewPrice] - [OldPrice])",
.FieldName = "OldPrice",
.SelectiveExpression = "[NewPrice] > 500",
.PredefinedFormatName = "TrafficLights3UnrimmedIconSet"
}
view.FormatConditions.Add(priceFormatCondition)
See Also
Formatting Values Using Icon Sets
Formatting Values Using Color Scales
Formatting Values Using Data Bars
IndicatorFormatConditionBase Class