GridFormatConditionColorScale.Format Property
Gets or sets the format (color scale) applied to cells.
Namespace: DevExpress.Web
Assembly: DevExpress.Web.v24.2.dll
NuGet Package: DevExpress.Web
#Declaration
[DefaultValue(GridConditionColorScaleFormat.GreenYellowRed)]
public GridConditionColorScaleFormat Format { get; set; }
#Property Value
Type | Default | Description |
---|---|---|
Grid |
Green |
One of the Grid |
Available values:
Name | Description |
---|---|
Green |
Cells are colored based on the green-yellow-red scale. |
Red |
Cells are colored based on the red-yellow-green scale. |
Green |
Cells are colored based on the green-white-red scale. |
Red |
Cells are colored based on the red-white-green scale. |
Blue |
Cells are colored based on the blue-white-red scale. |
Red |
Cells are colored based on the red-white-blue scale. |
Red |
Cells are colored based on the red-white scale. |
White |
Cells are colored based on the white-red scale. |
Green |
Cells are colored based on the green-white scale. |
White |
Cells are colored based on the white-green scale. |
Green |
Cells are colored based on the green-yellow scale. |
Yellow |
Cells are colored based on the yellow-green scale. |
Custom | Cells are colored based on the scale specified by the Grid |
#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);
}