Remarks

Use the FormatConditionRuleValue format to compare a value to a specific constant or constants, using the Equal, Less Than, Between, Greater Than, Not Equal and other operators. The comparison operator is specified by the Condition property. To specify a constant(s), with which a value is compared, use the Value1 and Value2 properties.

If the Condition property is set to None, a format is applied to all cells in the target column.

Example

This tutorial illustrates how to apply conditional formatting to a Market Share column in a GridControl to highlight cells that match a specific condition. This example highlights Market Share column values that are less than 20%.

To create a new formatting rule at design time, invoke the Format Rule Collection Editor from the Grid Designer. It can also be accessed from the Properties grid by clicking the ellipsis button for the ColumnView.FormatRules property.

Invoke the Grid Designer and switch to the Style Format Rules page (in the Appearance category).

Set the GridFormatRule.Column property to the Market Share column. This column provides values to test against the formatting rule.

By default, the format is applied to the same column. However, you can apply this format to another column by setting the GridFormatRule.ColumnApplyTo property. In addition, you can apply the format to the entire row by setting the GridFormatRule.ApplyToRow property to true.

Choose one of the predefined style formats using the FormatConditionRuleAppearanceBase.PredefinedName property. You can do this in the Properties tab or the Rule tab. The Rule tab additionally allows you to see a preview of the selected style. In this example, the Red Bold Text style format is selected.