Create the IconSetFormatCondition class instance and specify the following settings to create a conditional format in code:
The following code sample illustrates how to define a conditional format in markup:
XAML |
<dxg:TableView.FormatConditions>
<dxg:IconSetFormatCondition FieldName="Profit" PredefinedFormatName="Stars3IconSet"/>
</dxg:TableView.FormatConditions>
|
The code sample below illustrates how to define the same conditional format in code-behind:
C# |
var profitFormatCondition = new IconSetFormatCondition() {
FieldName = "Profit",
PredefinedFormatName = "Stars3IconSet"
};
view.FormatConditions.Add(profitFormatCondition);
|
VB |
Dim profitFormatCondition = New IconSetFormatCondition() With {
.FieldName = "Profit",
.PredefinedFormatName = "Stars3IconSet"
}
view.FormatConditions.Add(profitFormatCondition)
|