Conditional Formatting Rules Manager
- 4 minutes to read
The Conditional Formatting Rules Manager provides the capability to view and edit all conditional formatting rules currently applied to the grid's view, as well as create new ones. The manager is available both at design time and runtime.
Click the Manage Rules item in the Conditional Formatting Menu to invoke the manager.
Specify the type of records contained in the data source using the DataControlBase.DesignTimeDataObjectType property to make the manager correctly work at design time.
This topic consists of the following sections:
- Conditional Formatting Rules Manager Actions
- Conditional Formatting Rule Types
- Format Cells Dialog Window
- Conditional Formatting Rules Manager Specifics
Conditional Formatting Rules Manager Actions
The image below shows the conditional formatting rules manager.
The conditional formatting rules manager provides the following actions:
|New Rule... button||Opens the New Formatting Rule dialog for creating a new rule.|
|Edit Rule ... button||Opens the Edit Formatting Rule dialog for editing a selected rule. You can double-click a rule to open this dialog.|
|Delete Rule button||Deletes a selected rule.|
|Up/Down buttons||Reorders format rules in the rule list. This allows specifying their priority from high to low.|
|Apply to the row check box||Specifies whether to apply a rule to the entire row.|
|Column combo box||Specifies a field name of a column to which to apply a rule.|
|Is Enabled check box||Specifies whether to enable or disable a rule.|
|Show formatting rules for combo box||Allows filtering rules by a specified grid column.|
Conditional Formatting Rule Types
Use the conditional formatting rules manager to apply the following predefined rule types:
- Format all cells based on their values
- Format only cells that contain
- Format only top or bottom ranked values
- Format only values that are above or below average
- Format only unique or duplicate values
- Format only changing values
- Use a formula to determine which cells to format
Use the Format Cells dialog to define the applied rule's visual style.
Format all cells based on their values
Allows you to apply conditional formatting rules to cells based on their values. You can use the following format styles:
- 2-Color Scale and 3-Color Scale - Color cells depending on the specified rule conditions.
- Data Bar - Fills cells with bars whose lengths are proportional to the cell values.
- Icon Sets - Assigns an icon to each cell based on its value.
Format only cells that contain
Allows formatting cells comparing cell values with static values. Rules are based on the following types of cell content:
- Cell Value - Cells whose values are between (equal to, greater than, less than) the specified value(s).
- Specific Text - Cells whose values contain (begin/end with) the specified text.
- Dates Occurring - Date-time values that fall into a specified interval.
- Blanks - Cells with blank values.
Format only top or bottom ranked values
Allows formatting top or bottom ranked values.
Format only values that are above or below average
Allows formatting values that are above or below average.
Format only unique or duplicate values
Allows formatting values that are unique or duplicate.
Format only changing values
Allows formatting changing values in real time.
Use a formula to determine which cells to format
Allows specifying a custom condition for the rule.
Format Cells Dialog Window
The Format Cells dialog allows defining the visual appearance of the applied rule. Click the Format button in the New Formatting Rule (or Edit Formatting Rule) dialog to access this window.
Use the Format Cells dialog to specify the following settings:
- Font - Allows changing cell font attributes.
- Fill - Allows setting a cell background color.
- Icon - Allows selecting an icon displayed within the formatted cells.
Conditional Formatting Rules Manager Specifics
Use the TableView.ConditionalFormattingManagerServiceTemplate (or TreeListView.ConditionalFormattingManagerServiceTemplate) property to define a custom template for the conditional formatting rules manager.