GridFormatConditionExpressionBase.Format Property
Gets or sets the style format applied to cells whose values meet the format condition.
Namespace: DevExpress.Web
Assembly: DevExpress.Web.v24.2.dll
NuGet Package: DevExpress.Web
#Declaration
[DefaultValue(GridConditionHighlightFormat.LightRedFillWithDarkRedText)]
public GridConditionHighlightFormat Format { get; set; }
#Property Value
Type | Default | Description |
---|---|---|
Grid |
Light |
A Grid |
Available values:
Name | Description | Image |
---|---|---|
Light |
A cell background is light red, a text is dark red. |
|
Yellow |
A cell background is yellow, a text is dark yellow. |
|
Green |
A cell background is light green, a text is dark green. |
|
Light |
A cell background is light red. |
|
Light |
A cell background is light green. |
|
Red |
A cell text is red. |
|
Green |
A cell text is green. |
|
Bold |
A cell text is bold. |
|
Italic |
A cell text is italic. |
|
Strikethrough |
A cell text is stricken through. |
|
Custom | A cell formatting is specified by the Cell |
#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);
}