Skip to main content
All docs
V24.1

CardFormatRuleLayoutElement.CreateDimensionElement(String) Method

Creates a dimension layout element to which a format rule applies.

Namespace: DevExpress.DashboardCommon

Assembly: DevExpress.Dashboard.v24.1.Core.dll

NuGet Package: DevExpress.Dashboard.Core

Declaration

public static CardFormatRuleLayoutElement CreateDimensionElement(
    string dimensionId
)

Parameters

Name Type Description
dimensionId String

The dimension layout element’s identifier.

Returns

Type Description
CardFormatRuleLayoutElement

The card’s dimension layout element.

Remarks

The following example shows how apply the Value format rule to cards whose actual value is greater than the set condition value. The rule applies the green check icon to the card’s dimension layout element. The CreateDimensionElement method uses the element’s unique ID to obtain the dimension layout element.

using System.Windows.Forms;
using DevExpress.DashboardCommon;

CardDashboardItem cardItem = (CardDashboardItem)dashboardDesigner1.Dashboard.Items["cardDashboardItem1"];

CardItemDeltaFormatRule iconRule = new CardItemDeltaFormatRule();
iconRule.DeltaValueType = DeltaValueType.ActualValue;
iconRule.Card = cardItem.Cards[0];
FormatConditionValue valueCondition2 = new FormatConditionValue(DashboardFormatCondition.Greater, 1000000);
valueCondition2.StyleSettings = new IconSettings(FormatConditionIconType.IndicatorGreenCheck);
iconRule.Condition = valueCondition2;
var dimensionId = cardItem.SeriesDimensions[0].UniqueId;
CardFormatRuleLayoutElement dimensionLayoutElement = CardFormatRuleLayoutElement.CreateDimensionElement(dimensionId);
iconRule.ApplyToLayoutElement = dimensionLayoutElement;
cardItem.FormatRules.Add(iconRule);
See Also