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

GridFormatConditionExpressionBase.Format Property

Gets or sets the style format applied to cells whose values meet the format condition.

Namespace: DevExpress.Web

Assembly: DevExpress.Web.v19.1.dll

Declaration

[DefaultValue(GridConditionHighlightFormat.LightRedFillWithDarkRedText)]
public GridConditionHighlightFormat Format { get; set; }

Property Value

Type Default Description
GridConditionHighlightFormat **LightRedFillWithDarkRedText**

A GridConditionHighlightFormat object that provides formatting settings.

Available values:

Show 11 items
Name Description
LightRedFillWithDarkRedText

A cell background is light red, a text is dark red.

YellowFillWithDarkYellowText

A cell background is yellow, a text is dark yellow.

GreenFillWithDarkGreenText

A cell background is light green, a text is dark green.

LightRedFill

A cell background is light red.

LightGreenFill

A cell background is light green.

RedText

A cell text is red.

GreenText

A cell text is green.

BoldText

A cell text is bold.

ItalicText

A cell text is italic.

StrikethroughText

A cell text is stricken through.

Custom

A cell formatting is specified by the CellStyle, CardStyle, RowStyle, or LayoutItemStyle property.

Remarks

Use the Format property to specify a predefined format that will be applied to a cell whose value meets the format condition specified by the Rule property (GridFormatConditionHighlight.Rule or GridFormatConditionTopBottom.Rule).

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);
}
See Also