Back to Devexpress

IndicatorFormatConditionBase.SelectiveExpression Property

wpf-devexpress-dot-xpf-dot-grid-dot-indicatorformatconditionbase-3de9600b.md

latest3.1 KB
Original Source

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

NuGet Package : DevExpress.Wpf.Grid.Core

Declaration

csharp
public string SelectiveExpression { get; set; }
vb
Public Property SelectiveExpression As String

Property Value

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

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

csharp
var priceFormatCondition = new IconSetFormatCondition() {
   Expression = "Abs([NewPrice] - [OldPrice])",
   FieldName = "OldPrice",
   SelectiveExpression = "[NewPrice] > 500",
   PredefinedFormatName = "TrafficLights3UnrimmedIconSet"
};
view.FormatConditions.Add(priceFormatCondition);
vb
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

IndicatorFormatConditionBase Members

DevExpress.Xpf.Grid Namespace