GridFormatConditionColorScale.Format Property
Gets or sets the format (color scale) applied to cells.
Namespace: DevExpress.Web
Assembly: DevExpress.Web.v24.1.dll
NuGet Package: DevExpress.Web
Declaration
[DefaultValue(GridConditionColorScaleFormat.GreenYellowRed)]
public GridConditionColorScaleFormat Format { get; set; }
Property Value
Type | Default | Description |
---|---|---|
GridConditionColorScaleFormat | GreenYellowRed | One of the GridConditionColorScaleFormat enumeration values. |
Available values:
Name | Description |
---|---|
GreenYellowRed | Cells are colored based on the green-yellow-red scale. |
RedYellowGreen | Cells are colored based on the red-yellow-green scale. |
GreenWhiteRed | Cells are colored based on the green-white-red scale. |
RedWhiteGreen | Cells are colored based on the red-white-green scale. |
BlueWhiteRed | Cells are colored based on the blue-white-red scale. |
RedWhiteBlue | Cells are colored based on the red-white-blue scale. |
RedWhite | Cells are colored based on the red-white scale. |
WhiteRed | Cells are colored based on the white-red scale. |
GreenWhite | Cells are colored based on the green-white scale. |
WhiteGreen | Cells are colored based on the white-green scale. |
GreenYellow | Cells are colored based on the green-yellow scale. |
YellowGreen | Cells are colored based on the yellow-green scale. |
Custom | Cells are colored based on the scale specified by the GridFormatConditionColorScale.MaximumColor, GridFormatConditionColorScale.MiddleColor (optional), and GridFormatConditionColorScale.MinimumColor properties. |
Remarks
Use the Format property to specify a predefined color scale that will be used to color cells of a column specified by the GridFormatConditionBase.FieldName property.
If the Format property is set to Custom, you can specify a custom scale by using the GridFormatConditionColorScale.MinimumColor, GridFormatConditionColorScale.MiddleColor (optional), and GridFormatConditionColorScale.MaximumColor properties.
Example
...
{
CardViewFormatConditionColorScale Format1 = new CardViewFormatConditionColorScale();
Format1.FieldName = "Discount";
Format1.Format = GridConditionColorScaleFormat.GreenYellow;
Format1.MinimumValue = 0.15;
Format1.MaximumValue = 0.25;
CardViewFormatConditionHighlight Format2 = new CardViewFormatConditionHighlight();
Format2.Format = GridConditionHighlightFormat.Custom;
Format2.CardStyle.BackColor = Color.Orange;
Format2.ApplyToCard = true;
Format2.Rule = GridConditionRule.Expression;
Format2.Expression = "[Quantity] < 50";
Format2.FieldName = "Quantity";
CardViewFormatConditionTopBottom Format3 = new CardViewFormatConditionTopBottom();
Format3.FieldName = "UnitPrice";
Format3.Format = GridConditionHighlightFormat.BoldText;
Format3.Rule = GridTopBottomRule.TopItems;
Format3.Threshold = 10;
ASPxCardView1.FormatConditions.Add(Format1);
ASPxCardView1.FormatConditions.Add(Format2);
ASPxCardView1.FormatConditions.Add(Format3);
}