Back to Devexpress

GridViewFormatConditionColorScale Class

aspnet-devexpress-dot-web-efc762e6.md

latest5.1 KB
Original Source

GridViewFormatConditionColorScale Class

A grid format condition that allows you to color grid cells.

Namespace : DevExpress.Web

Assembly : DevExpress.Web.v25.2.dll

NuGet Package : DevExpress.Web

Declaration

csharp
public class GridViewFormatConditionColorScale :
    GridFormatConditionColorScale
vb
Public Class GridViewFormatConditionColorScale
    Inherits GridFormatConditionColorScale

The following members return GridViewFormatConditionColorScale objects:

Remarks

ASPxGridView supports conditional formatting, i.e., automatically applies cell formatting based on the specified rules. The ASPxGridView.FormatConditions property provides access to a collection of rules which are represented by the GridFormatConditionBase class descendants.

Use the GridViewFormatConditionColorScale object to create a format condition allowing you to color grid cells. The conditional formatting is determined for the column specified by the GridFormatConditionBase.FieldName property. By default, the formatting is applied to the same column. However, you can specify the column to which the formatting will be applied using the GridViewFormatConditionColorScale.ShowInColumn property. The format (color scale) can be specified by the GridFormatConditionColorScale.Format property. 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.

Online Demo

Conditional Formatting

Example

aspx
<dx:ASPxGridView runat="server" ... >
        <Columns>...</Columns>
     <FormatConditions>
          <dx:GridViewFormatConditionTopBottom FieldName="UnitPrice" Rule="AboveAverage" Format="RedText" />
          <dx:GridViewFormatConditionHighlight FieldName="Discount" Expression="[Discount] > 0" Format="GreenFillWithDarkGreenText" />
          <dx:GridViewFormatConditionColorScale FieldName="Quantity" Format="BlueWhiteRed" />
          <dx:GridViewFormatConditionIconSet FieldName="Total" Format="Ratings5" />
     </FormatConditions>
</dx:ASPxGridView>

Implements

IStateManager

IPropertiesOwner

IExpressionsAccessor

Inheritance

Object StateManager CollectionItem GridFormatConditionBase GridFormatConditionIndicatorBase GridFormatConditionColorScale GridViewFormatConditionColorScale

See Also

GridViewFormatConditionColorScale Members

Conditional Formatting

DevExpress.Web Namespace