RulesManager for WinForms
ルール

Rules Manager allows you to format data using the conditional formatting rules to highlight values based on conditions, visualize data by using data bars, color scales, and icon sets that correspond to certain variations in the data. Such conditional formatting rules can be applied to the cells whose values meet a certain condition specified by the rules. These conditional formatting rules are represented by the Rule class which allows you to easily create the conditional formatting rules, similar to MS Excel. The Rule class provides Expression property which sets the values or expressions for the rules. Additionally, the conditional formatting style can be set using the ItemStyle class.

Let us learn about how the highlight cell, data bar, color scale, and icon set rules can be used for formatting data with the help of the Rules Manager control.

Highlight Cell Rule

Highlight cell rules allow you to highlight a cell or cell range whose values meet a specific condition. You can use this rule to set the cell background color, border line color or font color to highlight data that meets any of the following conditions specified by the rule:

You can define these conditions using expressions and enter a value or formula against which each cell is compared. If the cell data satisfies that criteria, only then the formatting is applied. For more information on creating highlight cell rule through code, see Highlight Cell Rule section in the Create and Delete Rules topic.

Data Bar Rule

Data bar rules create visual effects in the data making it easier to compare the values in a cell range. These conditional formatting rules lets you visualize numeric values using bars by displaying larger values through longer bars and smaller values through shorter bars. For example, the data bar rule can be used in a scenario where you want to visualize a product's sales every month in an year to understand which months had higher and lower sales.

With data bar rule, you can format the cells using solid as well as gradient colors. For more information on creating data bar rule through code, see Data Bar Rule section in the Create and Delete Rules topic.

Color Scale Rule

Color scale rule lets you visualize the distribution and variation of data. In this case, the cells are shaded with gradation of colors that correspond to minimum, midpoint, and maximum thresholds. For example, the color scale rule can be used in a scenario where you to want to showcase temperature variation of a location during an year. For more information on creating color scale rule through code, see Color Scale Rule section in the Create and Delete Rules topic.

Icon Set Rule

Icon set rule can be used to present data in categories that are distinguished by a threshold value wherein each icon represents a range of values and each cell in that range is annotated with the icon representing that range. For example, you can use this rule in a scenario where you want to categorize data, let's say, using three-icon set wherein one icon can be used to highlight all values that are greater than or equal to 80 percent, second icon can be used to highlight values that are less than 80 percent and greater than or equal to 50 percent, and the third icon can be used for values that are less than 50 percent. For more information on creating icon set rule through code, see Icon Set Rule section in the Create and Delete Rules topic.