Conditional Formatting Menu
- 3 minutes to read
The Conditional Formatting Menu allows users to apply conditional formatting rules at runtime.
Right-click the column to which you want to add a conditional formatting rule and select Conditional Formatting item in the displayed context menu to invoke the conditional formatting menu.
You can enable the conditional formatting menu as follows:
- Set the view’s TableView.AllowConditionalFormattingMenu (or TreeListView.AllowConditionalFormattingMenu) property to true.
- Set the column’s ColumnBase.AllowConditionalFormattingMenu property to true to enable conditional formatting menu for the required column. This approach has higher priority than setting the view’s property.
Note
Specify the type of records contained in the data source using the DataControlBase.DesignTimeDataObjectType property to make the conditional formatting menu correctly work at design time.
The conditional formatting menu allows you to use only predefined formats. Refer to the Specifying Formats section of the Conditional Formats topic to learn more.
Conditional Formatting Menu Items
The conditional formatting menu consists of the following items:
- Highlight Cells Rules
- Top/Bottom Rules
- Data Update Rules
- Data Bars
- Color Scales
- Icon Sets
- Clear Rules
- Manage Rules
Highlight Cells Rules
The Highlight Cells Rules submenu allows applying the following conditional formatting rules:
- Greater Than, Less Than, Between, Equal To, Text That Contains formats cells comparing their values with static values.
- Duplicate Values formats cells whose values are duplicate.
- Formatting Date-Time Values highlights date-time values that fall into a specified interval.
- Formatting Values Using Custom Conditions applies complex conditions.
Top/Bottom Rules
The Top/Bottom Rules submenu allows highlighting a specific number of topmost-bottommost values, and values that are above or below an average value.
Data Update Rules
The Data Update Rules submenu allows visualizing changing values in real time.
Data Bars
The Data Bars submenu allows visualizing numeric values using predefined sets of bars.
Color Scales
The Color Scales submenu allows using predefined sets of colors to apply conditional formatting to different ranges of values.
Icon Sets
The Icon Sets submenu allows using predefined sets of icons to apply conditional formatting to different ranges of values.
Clear Rules
If you have already applied rules to columns, the Clear Rules submenu becomes available. This submenu allows deleting rules from a single or all columns.
Manage Rules
The item allows invoking the Conditional Formatting Rules Manager to create new rules and edit applied rules.
Conditional Formatting Menu Specifics
Call the TableView.ShowFormatConditionDialog (or TreeListView.ShowFormatConditionDialog) method to invoke a conditional format dialog in code.
Use the TableView.FormatConditionDialogServiceTemplate (or TreeListView.FormatConditionDialogServiceTemplate) property to define a custom template for a conditional format dialog.