[Expand]General Information
[Expand]WinForms Controls
[Expand]ASP.NET Controls and MVC Extensions
[Expand]ASP.NET Bootstrap Controls
[Expand]ASP.NET Core Bootstrap Controls
[Expand]WPF Controls
[Expand]Xamarin Controls
[Expand]Windows 10 App Controls
[Expand]Office File API
[Expand]Reporting
[Expand]Report and Dashboard Server
[Collapse]Dashboard
 [Expand]Getting Started
 [Expand]Basic Concepts and Terminology
 [Collapse]Common Features
   Supported Data Sources
  [Expand]Connecting to a Data Source
   Data Preparation
   Binding to Data
  [Expand]Data Shaping
  [Expand]Interactivity
  [Collapse]Appearance Customization
    Conditional Formatting
    Coloring
    Data Display Formatting
  [Expand]Advanced Analytics
   Dashboard Layout
   Printing and Exporting
 [Expand]Creating the Designer and Viewer Applications
 [Expand]Creating Dashboards
 [Expand]Visual Studio Integration
  End-User Documentation
  Localization
 [Expand]Redistribution and Deployment
  Video Tutorials
 [Expand]Examples
 [Expand]Member Tables
 [Expand]API Reference
[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)

Conditional Formatting

The DevExpress Dashboard allows you to format dashboard item elements whose values meet a specified condition. This feature allows you to highlight specific elements using a predefined set of rules.

Expanded Conditional Formatting Overview

Comparison rules used in conditional formatting can be divided into the following groups.

Format Condition Description Example Condition class
Value Allows you to compare static values (such as Greater Than, Less Than, Between, etc.). FormatConditionValue
Top-Bottom Highlights a specific number of topmost/bottommost values. FormatConditionTopBottom
Average Highlights values above and below an average. FormatConditionAverage
A Date Occurring Allows you to highlight date-time values that fall into a specified interval relative to the current date. FormatConditionDateOccuring
Expression Allows you to use complex conditions to apply formatting. You can also pass dashboard parameters to expressions. FormatConditionExpression
Icon Ranges Allows you to apply formatting by displaying specific icons for different ranges of values. You can select a predefined set of icons or use a specific icon for each range. FormatConditionRangeSet
Color Ranges Allows you to apply formatting using specific colors for different ranges of values. You can select a predefined set of colors or use custom appearance settings to highlight values within specified ranges. FormatConditionRangeSet
Gradient Ranges Allows you to apply formatting using gradient color scales. FormatConditionRangeGradient
Bar Allows you to visualize numeric values using bars. You can also color bars corresponding to positive and negative values using different colors. FormatConditionBar
Bar Color Ranges Allows you to visualize numeric values using bars whose colors are contained in the specified color set. FormatConditionColorRangeBar
Bar Gradient Ranges Allows you to visualize numeric values using bars whose colors are contained in the specified color gradient. FormatConditionGradientRangeBar

You can apply conditional formatting to measure or dimension values. The table below lists format conditions that can be applied to different types of data items.

Data Item

Supported Format Conditions

Measure/numeric Dimension

Value

Top-Bottom

Average

Expression

Icon Ranges

Color Ranges

Gradient Ranges

Bar

Bar Color Ranges

Bar Gradient Ranges

string Dimension

Value with the condition type set to Equal To, Not Equal To or Text that Contains

Expression

date-time Dimension

Value

A Date Occurring for dimensions with the continuous date-time group interval

Expression

Icon Ranges

Color Ranges

Gradient Ranges

Bar

Bar Color Ranges

Bar Gradient Ranges

Expanded How to Apply Conditional Formatting

The topics below describe how to use conditional formatting in the WinForms Designer and on the web.

Expanded How to Apply Conditional Formatting in Code

Dashboard items that support conditional formatting expose the FormatRules property providing access to a collection of the DashboardItemFormatRule descendants.

To create a new rule, do the following.

Finally, add the created format rule to the FormatRules collection exposed by the dashboard item. To learn more, see the Conditional Formatting topic for the required dashboard item.

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