Skip to main content
A newer version of this page is available. .

ColorScaleFormat Class

Contains formatting settings for a Color Scales conditional format.

Namespace: DevExpress.Xpf.Core.ConditionalFormatting

Assembly: DevExpress.Xpf.Core.v19.1.dll

Declaration

public class ColorScaleFormat :
    IndicatorFormatBase

The following members return ColorScaleFormat objects:

Remarks

The ColorScaleFormat class instances are used to set the GridControl’s ColorScaleFormatCondition.Format and PivotGridControl’s ColorScaleFormatCondition.Format properties.

The following image shows the color scale formatting.

CFcolorscales

The code sample below illustrates how to create the color scale conditional formatting rule with a custom format in markup for GridControl.

<dxg:TableView.FormatConditions>
   <dxg:ColorScaleFormatCondition FieldName="Sales">
      <dx:ColorScaleFormat ColorMin="White" ColorMiddle="Green" ColorMax="Red"/>
   </dxg:ColorScaleFormatCondition>
</dxg:TableView.FormatConditions>

The code sample below illustrates how to define the same conditional formatting rule in code-behind for GridControl.

var salesFormatCondition = new ColorScaleFormatCondition() {
   FieldName = "Sales",
   Format = new ColorScaleFormat() {
      ColorMin = Colors.White,
      ColorMiddle = Colors.Green,
      ColorMax = Colors.Red
   }
};
view.FormatConditions.Add(salesFormatCondition);

The following code snippet (auto-collected from DevExpress Examples) contains a reference to the ColorScaleFormat class.

Note

The algorithm used to collect these code examples remains a work in progress. Accordingly, the links and snippets below may produce inaccurate results. If you encounter an issue with code examples below, please use the feedback form on this page to report the issue.

Inheritance

Object
DispatcherObject
DependencyObject
Freezable
DevExpress.Xpf.Core.ConditionalFormatting.IndicatorFormatBase
ColorScaleFormat
See Also