Back to Devexpress

Conditional Formatting Rules Manager

wpf-113996-controls-and-libraries-data-grid-conditional-formatting-creating-conditional-formatting-rules-conditional-formatting-rules-manager.md

latest8.1 KB
Original Source

Conditional Formatting Rules Manager

  • Oct 25, 2021
  • 4 minutes to read

The Conditional Formatting Rules Manager allows you 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.

Select the GridControl or a column, invoke the Quick Actions, and select Manage Conditional Formatting Rules to invoke the manager at design time.

Click the Manage Rules item in the Conditional Formatting Menu to invoke the manager at runtime.

Set the TableView.AllowConditionalFormattingManager (or TreeListView.AllowConditionalFormattingManager) property to true to enable the manager at runtime.

Note

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

The image below shows the conditional formatting rules manager.

The conditional formatting rules manager provides the following actions:

ElementAction
New Rule… buttonOpens the New Formatting Rule dialog for creating a new rule.
Edit Rule … buttonOpens the Edit Formatting Rule dialog for editing a selected rule. You can double-click a rule to open this dialog.
Delete Rule buttonDeletes a selected rule.
Up/Down buttonsReorders format rules in the rule list. This allows specifying their priority from high to low.
Apply to the row check boxSpecifies whether to apply a rule to the entire row.
Column combo boxSpecifies a field name of a column to which to apply a rule.
Is Enabled check boxSpecifies whether to enable or disable a rule.
Show formatting rules for combo boxAllows filtering rules by a specified grid column.

Conditional Formatting Rule Types

Use the conditional formatting rules manager to apply the following predefined rule types:

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:

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

Call the TableView.ShowConditionalFormattingManager (or TreeListView.ShowConditionalFormattingManager) method to invoke the conditional formatting rules manager in code.

Use the TableView.ConditionalFormattingManagerServiceTemplate (or TreeListView.ConditionalFormattingManagerServiceTemplate) property to define a custom template for the conditional formatting rules manager.

See Also

Conditional Formats

Conditional Formatting Menu