Skip to main content

ColorScaleFormatCondition Class

Represents a color scale format condition.

Namespace: DevExpress.Mobile.DataGrid

Assembly: DevExpress.Mobile.Grid.v18.2.dll

Declaration

public class ColorScaleFormatCondition :
    IndicatorFormatConditionBase

Remarks

Important

This documentation topic describes legacy technology. We no longer develop new functionality for the GridControl and suggest that you use the new DataGridView control instead.

Example

This example demonstrates how to apply a color scale format to the Total column in a GridControl. A color scale format reflects data distribution of column cell values using a gradient of two or three colors. In this example, the predefined Red-Yellow-Green color scale is used.

ConditionalFormatting_ColorScale

  1. Create a new ColorScaleFormatCondition class instance.
  2. Set this object’s FormatConditionBase.FieldName property to Total. This column provides values to test against the formatting rule and the specified format will be applied to this column.
  3. Assign one of the predefined color scales to the FormatConditionBase.PredefinedFormatName property. All available format names are listed in the Predefined Format Names document.
  4. To apply a conditional formatting rule represented by the created ColorScaleFormatCondition object, add this object to the GridControl.FormatConditions collection.
using DevExpress.Mobile.DataGrid;
// ...

ColorScaleFormatCondition condition = new ColorScaleFormatCondition();
condition.FieldName = "Total";
condition.PredefinedFormatName = "RedYellowGreenColorScale";

grid.FormatConditions.Add (condition);

Inheritance

See Also