All docs
V20.2
20.2
20.1
The page you are viewing does not exist in version 20.1. This link will take you to the root page.
19.2
The page you are viewing does not exist in version 19.2. This link will take you to the root page.
19.1
The page you are viewing does not exist in version 19.1. This link will take you to the root page.
18.2
The page you are viewing does not exist in version 18.2. This link will take you to the root page.
18.1
The page you are viewing does not exist in version 18.1. This link will take you to the root page.
17.2
The page you are viewing does not exist in version 17.2. This link will take you to the root page.

CardFormatRuleLayoutElement.CreateTextElement(String) Method

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

Namespace: DevExpress.DashboardCommon

Assembly: DevExpress.Dashboard.v20.2.Core.dll

Declaration

public static CardFormatRuleLayoutElement CreateTextElement(
    string text
)
Public Shared Function CreateTextElement(
    text As String
) As CardFormatRuleLayoutElement

Parameters

Name Type Description
text String

The text layout element's display text.

Returns

Type Description
CardFormatRuleLayoutElement

The card's text layout element.

Remarks

The following example shows how to 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 text layout element. The CreateTextElement method obtains the text layout element by the element's display text.

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;
CardFormatRuleLayoutElement text = CardFormatRuleLayoutElement.CreateTextElement("Sales: ");
iconRule.ApplyToLayoutElement = text;
cardItem.FormatRules.Add(iconRule);
See Also