Back to Devexpress

CardViewFormatConditionHighlight.CardStyle Property

aspnet-devexpress-dot-web-dot-cardviewformatconditionhighlight.md

latest3.2 KB
Original Source

CardViewFormatConditionHighlight.CardStyle Property

Gets the style settings defining the custom conditional formatting applied to cards.

Namespace : DevExpress.Web

Assembly : DevExpress.Web.v25.2.dll

NuGet Package : DevExpress.Web

Declaration

csharp
public CardViewCardStyle CardStyle { get; }
vb
Public ReadOnly Property CardStyle As CardViewCardStyle

Property Value

TypeDescription
CardViewCardStyle

A CardViewCardStyle object that contains the style settings.

|

Remarks

When the GridFormatConditionExpressionBase.Format property is set to Custom and the CardViewFormatConditionHighlight.ApplyToCard property is set to true, use the CardStyle property to specify the style settings that are applied to a card whose cell’s value meets the condition specified by the GridFormatConditionHighlight.Rule property.

Online Demo

Conditional Formatting

Example

csharp
...
{
    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

Conditional Formatting

Format

ApplyToCard

Rule

CardViewFormatConditionHighlight Class

CardViewFormatConditionHighlight Members

DevExpress.Web Namespace