[Expand]General Information
[Expand]WinForms Controls
[Expand]ASP.NET Controls and MVC Extensions
[Expand]ASP.NET Bootstrap Controls
[Expand]ASP.NET Core Bootstrap Controls
[Collapse]WPF Controls
  Prerequisites
 [Expand]What's Installed
 [Expand].NET Core 3 Support
 [Expand]Common Concepts
 [Expand]MVVM Framework
 [Collapse]Controls and Libraries
   Reporting
  [Expand]Data Grid
  [Expand]Ribbon, Bars and Menu
  [Expand]Charts Suite
  [Expand]Pivot Grid
  [Expand]Scheduler
  [Collapse]Spreadsheet
    Product Structure
   [Expand]Getting Started
   [Expand]Spreadsheet Document
    Supported Formats
   [Expand]Cell Basics
   [Expand]Formulas
    Defined Names
    Data Binding
    Data Validation
   [Expand]Data Presentation
   [Expand]Pivot Table Overview
   [Expand]Charts and Graphics
    Printing
    Events
    Protection
    Operation Restrictions
    Find and Replace
   [Expand]Mail Merge
   [Collapse]Visual Elements
    [Collapse]Dialogs
      Format Cells Dialog
      Paste Special Dialog
      Edit Hyperlink Dialog
      Symbol Dialog
      Create Table Dialog
      Change Chart Type Dialog
      Find and Replace Dialog
      Encrypt Document Dialog
      Password Dialog
      Protect Workbook Dialog
      Protect Sheet Dialog
      User Permissions Dialog
      Insert Function Dialog
      Function Arguments Dialog
      Name Manager
      New Name Dialog
      Create Names from Selection Dialog
      Subtotal Dialog
      Data Validation Dialog
      Properties Dialog
      Page Setup Dialog
      Header and Footer Dialog
      Create PivotTable Dialog
      Move PivotTable Dialog
      Change PivotTable Data Source Dialog
      PivotTable Field List
      PivotTable Value Field Settings Dialog
      PivotTable Field Settings Dialog
      PivotTable Sort Dialog
      Insert Calculated Field Dialog
      Insert Calculated Item Dialog
      PivotTable Solve Order Dialog
      PivotTable Options Dialog
      New Formatting Rule Dialog
      Conditional Formatting Rules Manager
     Pop-up Menus
    Services
    Themes and Templates
   [Expand]Shortcuts
   [Expand]Examples
  [Expand]Rich Text Editor
  [Expand]Tree List
  [Expand]Gauge Controls
  [Expand]Map Control
  [Expand]Layout Management
  [Expand]Windows Modern UI
  [Expand]Printing-Exporting
  [Expand]Data Editors
  [Expand]Navigation Controls
  [Expand]Spell Checker
  [Expand]Property Grid
  [Expand]PDF Viewer
  [Expand]TreeMap Control
  [Expand]Gantt Control
  [Expand]Diagram Control
  [Expand]Windows and Utility Controls
   Dialogs, Notifications and Panels
  [Expand]Scheduler (legacy)
 [Expand]Scaffolding Wizard
 [Expand]Localization
  Redistribution and Deployment
  Get More Help
 [Expand]API Reference
[Expand]Xamarin Controls
[Expand]Windows 10 App Controls
[Expand]Office File API
[Expand]Reporting
[Expand]Report and Dashboard Server
[Expand]Dashboard
[Expand]eXpressApp Framework
[Expand]eXpress Persistent Objects
[Expand]CodeRush
[Expand]CodeRush Classic
[Expand]Cross-Platform Core Libraries
[Expand]Tools and Utilities
 End-User Documentation
View this topic on docs.devexpress.com (Learn more)

New Formatting Rule Dialog

The New Formatting Rule dialog allows end-users to create new conditional formatting rules and customize the appearance of cells that meet the given criteria.

This dialog can be invoked by clicking the New Rule… item in the Conditional Formatting drop-down menu. To provide end-users with this menu, add the Styles ribbon page group to the SpreadsheetControl. See the Lesson 1 - Create a Simple Spreadsheet topic for an example on how to provide a ribbon UI for the spreadsheet application.

In the invoked dialog, end-users can select the type of a new conditional rule by clicking the required item in the Select a Rule Type list. The available types of conditional formatting rules are listed in the following table.

Rule Type

Description

API Objects

Format all cells based on their values

Allows end-users to create the rules to format cells using 2- and 3-color scales, icons sets and data bars.

ColorScale2ConditionalFormatting

ColorScale3ConditionalFormatting

IconSetConditionalFormatting

DataBarConditionalFormatting

Format all cells that contain...

Allows end-users to create the conditional formatting rules to highlight cells that...

  • meet the criteria represented by a relational operator;
  • contain the given text string or fall within the specified time period;
  • are between or not between two values;
  • contain empty values;
  • contain formula errors.

RangeConditionalFormatting

ExpressionConditionalFormatting

SpecialConditionalFormatting

TimePeriodConditionalFormatting

Format only top or bottom ranked values

Represents the conditional formatting rule that highlights only the top or bottom ranked values in a range of cells.

RankConditionalFormatting

Format only cells that are above or below average

The conditional formatting rule of this type highlights values that are above or below the average in a range of cells.

AverageConditionalFormatting

Format only unique or duplicate values

Allows end-users to apply the conditional formatting rule to highlight unique or duplicate values.

SpecialConditionalFormatting

Use a formula to determine which cells to format

Represents the conditional formatting rule based on the specified formula.

FormulaExpressionConditionalFormatting

The Edit the Rule Description section of the New Formatting Rule dialog contains various options allowing end-users to specify the rule attributes and format settings to be applied to cells that meet the criteria. Note that options appearing in the Edit the Rule Description section highly depend on the rule type currently selected in the Select a Rule Type list.

To define the format settings for specific rule types, the Format Cells dialog is used. To invoke it, an end-user should click the Format button. After the required formatting options are specified, the resulting cell appearance is displayed in the Preview box.

If a data bar conditional formatting rule is selected, the Negative Value and Axis... button appears in the Edit the Rule Description section. Clicking this button invokes the Negative Value and Axis Settings dialog, which enables end-users to specify the negative bar fill and border colors, and select the axis color and its position within a cell.

To create the conditional formatting rules using the Spreadsheet API, use the corresponding methods of the ConditionalFormattingCollection collection. For more information, refer to the examples in the Conditional Formatting section.

Is this topic helpful?​​​​​​​