Log In
Home
Support
Demos
Documentation
Blogs
Training
Webinars
[Expand]Welcome to DevExpress .NET Documentation
[Expand]WinForms Controls
[Collapse]ASP.NET Controls and MVC Extensions
 [Expand]Prerequisites
 [Expand]What's Installed
 [Expand]Common Concepts
 [Collapse]ASP.NET WebForms Controls
   Getting Started
  [Expand]Reporting
  [Expand]Chart Control
  [Collapse]Grid View
   [Expand]Product Information
    Getting Started
   [Expand]Fundamentals
   [Collapse]Concepts
    [Expand]Binding to Data
    [Expand]Data Representation Basics
    [Expand]Focus and Navigation
    [Expand]Data Editing
    [Expand]Data Shaping and Manipulation
    [Collapse]Data Formatting
      Conditional Formatting
      Format Condition Types
      Formatting via Events
      Standard Formatting Mechanism
      Creating Conditional Formatting Rules
    [Expand]Master-Detail Relationship
     Appearance Customization
     Adaptivity
     Save and Restore Layout
    [Expand]Templates
    [Expand]Export
     Toolbars
    [Expand]ASPxGridLookup
    ASPxGridView Designer
   [Expand]Visual Elements
   [Expand]Examples
   [Expand]Member Tables
   [Expand]ASPxGridView - Animated Images
  [Expand]Card View
  [Expand]Vertical Grid
  [Expand]Spreadsheet
  [Expand]Rich Text Editor
  [Expand]Image and Data Browsing
  [Expand]Docking and Popups
  [Expand]Site Navigation and Layout
  [Expand]File Management
  [Expand]Multi-Use Site Controls
  [Expand]Scheduler
  [Expand]HTML Editor
  [Expand]Pivot Grid
  [Expand]Tree List
  [Expand]Gauges
  [Expand]Data Editors
  [Expand]Spell Checker
  [Expand]Query Builder
 [Expand]ASP.NET MVC Extensions
 [Expand]Localization
 [Expand]Redistribution and Deployment
  Get More Help
 [Expand]API Reference
[Expand]ASP.NET Bootstrap Controls
[Expand]ASP.NET Core Bootstrap Controls
[Expand]WPF Controls
[Expand]Xamarin Controls
[Expand]Windows 10 App Controls
[Expand]Document Server
[Expand]Reporting
[Expand]Report Server
[Expand]Dashboard
[Expand]eXpressApp Framework
[Expand]CodeRush
[Expand]CodeRush Classic
[Expand]Cross-Platform Core Libraries
[Expand]Tools and Utilities
 End-User Documentation

Format Condition Types

The ASPxGridView control provides the following types of format conditions.

Expanded Color Scale Format Condition

The GridViewFormatConditionColorScale format condition allows you to color grid cells using a two-color or three-color scale. Cells are shaded with gradations of two or three colors that correspond to minimum, middle, and maximum thresholds.

The conditional formatting is determined for the column specified by the GridFormatConditionBase.FieldName property. By default, formatting is applied to the same column. However, you can specify the column to which formatting will be applied using the GridViewFormatConditionColorScale.ShowInColumn property. The format (color scale) can be specified by the GridFormatConditionColorScale.Format property, which provides a number of predefined formats.

Custom Format
If the GridFormatConditionColorScale.Format property is set to Custom, you can specify custom colors for a scale by using the GridFormatConditionColorScale.MinimumColor, GridFormatConditionColorScale.MiddleColor (optional), and GridFormatConditionColorScale.MaximumColor properties.

Example

The code snippets below demonstrate how to create and customize a color scale format condition at design time and at runtime.

Expanded Highlight Format Condition

The GridViewFormatConditionHighlight format condition allows you to highlight cell values based on a custom expression.

The conditional formatting is determined for the column specified by the GridFormatConditionBase.FieldName property. By default, formatting is applied to the same column. However, you can specify the column to which formatting will be applied using the GridViewFormatConditionHighlight.ShowInColumn property. The style format, which can be specified by the GridFormatConditionExpressionBase.Format property, is applied to a cell (or row, provided the GridViewFormatConditionHighlight.ApplyToRow property is set to true) whose value meets the condition specified by the GridFormatConditionHighlight.Rule property. When this property is set to Expression, use the GridFormatConditionHighlight.Expression property to specify a custom rule expression.

Custom Format
If the GridFormatConditionExpressionBase.Format property is set to Custom, the formatting style can be specified by the GridViewFormatConditionHighlight.CellStyle or GridViewFormatConditionHighlight.RowStyle property, based on the GridViewFormatConditionHighlight.ApplyToRow property value.

The code snippets below demonstrate how to create and customize a highlight format condition at design time and at runtime.

Expanded Icon Set Format Condition

The GridViewFormatConditionIconSet format condition allows you to provide grid cells with predefined icons.

The conditional formatting is determined for the column specified by the GridFormatConditionBase.FieldName property. By default, formatting is applied to the same column. However, you can specify the column to which formatting will be applied using the GridViewFormatConditionIconSet.ShowInColumn property. The format (icon set) can be specified by the GridFormatConditionIconSet.Format property.

The code snippets below demonstrate how to create and customize an icon set format condition at design time and at runtime.

Expanded Top/Bottom Format Condition

The GridViewFormatConditionTopBottom format condition allows you to highlight top or bottom cell values.

Conditional formatting is determined for the column specified by the GridFormatConditionBase.FieldName property. By default, formatting is applied to the same column. However, you can specify the column to which formatting will be applied using the GridViewFormatConditionTopBottom.ShowInColumn property. The style format, which can be specified by the GridFormatConditionExpressionBase.Format property, is applied to a cell (or row, provided the GridViewFormatConditionTopBottom.ApplyToRow property is set to true) whose value meets the condition specified by the GridFormatConditionTopBottom.Rule property. When the GridFormatConditionTopBottom.Rule property is set to BottomItems, BottomPercent, TopItems, or TopPercent values, use the GridFormatConditionTopBottom.Threshold property to specify additional condition information, i.e., the number of items or the percentage. The AboveAverage and BelowAverage values do not require additional parameters.

Custom Format
If the GridFormatConditionExpressionBase.Format property is set to Custom, the formatting style can be specified by the GridViewFormatConditionTopBottom.CellStyle or GridViewFormatConditionTopBottom.RowStyle property (based on the GridViewFormatConditionTopBottom.ApplyToRow property value).

The code snippets below demonstrate how to create and customize a top/bottom scale format condition at design time and at runtime.

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