Skip to main content

Creating Conditional Formatting Rules

Conditional formatting rules can be created at design time and runtime.

Create any of the following conditional formatting rules (GridFormatConditionBase class descendants) and add them to the FormatConditions collection:

The Rule property allows you to specify the style format rule, which defines the condition and appearance settings applied when the specified condition is true. The Format property defines the format settings applied to cells whose values take part in conditional formatting.

Refer to the following help topic for more information: Conditional Formatting Types.

...
<FormatConditions>
    <dx:CardViewFormatConditionTopBottom Rule="BottomItems" Threshold="10" FieldName="Price" Format="BoldText" />
    <dx:CardViewFormatConditionTopBottom Rule="BottomItems" Threshold="10" FieldName="Price" Format="GreenText" />
    <dx:CardViewFormatConditionTopBottom Rule="TopItems" Threshold="10" FieldName="Price" Format="BoldText" />
    <dx:CardViewFormatConditionTopBottom Rule="TopItems" Threshold="10" FieldName="Price" Format="RedText" />
    <dx:CardViewFormatConditionIconSet FieldName="Baths" Format="Arrows3Colored" />
    <dx:CardViewFormatConditionIconSet FieldName="Beds" Format="Arrows3Colored" />
    <dx:CardViewFormatConditionTopBottom FieldName="HouseSize" Rule="TopItems" Threshold="5" Format="GreenText" />
    <dx:CardViewFormatConditionTopBottom FieldName="HouseSize" Rule="BottomItems" Threshold="5" Format="RedText" />
</FormatConditions>
...