Skip to main content
A newer version of this page is available. .
.NET Framework 4.5.2+

AppearanceAttribute.FontColor Property

Specifies the font color of AppearanceAttribute.TargetItems affected by the conditional appearance rule generated from this attribute instance.

Namespace: DevExpress.ExpressApp.ConditionalAppearance

Assembly: DevExpress.Persistent.Base.v20.2.dll

Declaration

public string FontColor { get; set; }

Property Value

Type Description
String

A string specifying the font color of target items affected by the conditional appearance rule. A value should be recognizable by the System.Drawing.ColorConverter class.

Remarks

The following UI elements can change their font color:

  • Data cells in a GridListEditor and ASPxGridListEditor (the font color of the displayed text)
  • Nodes in a TreeListEditor and ASPxTreeListEditor (the font color of the displayed text)
  • Property Editors that are inherited from the DXPropertyEditor and WebPropertyEditor types (the font color of the displayed text)
  • StaticText (the font color of the displayed text)
  • Layout Items, Layout Groups and Tabbed Layout Groups (the font color of the caption)

Example 1

According to the rule demonstrated in the example below, the Category property in List Views will be displayed in Blue font color when its value is “Seafood”.

using DevExpress.ExpressApp.ConditionalAppearance;
//...
[Appearance("CategoryColoredInListView", AppearanceItemType = "ViewItem", TargetItems = "Category",
 Criteria = "Category = 'Seafood'", Context = "ListView", FontColor = "Blue", Priority = 1)]
public class Product : BaseObject {
    public Product(Session session) : base(session) { }
    public Category Category {
        //...
    }
}
[DefaultProperty(nameof(Name))]
public class Category : BaseObject {
    public Category(Session session) : base(session) {}
    public string Name {
        //...
    }
}

Example 2

According to the rule demonstrated in the example below, the “ProductParameters” layout group caption in the Product Detail View will be displayed in Blue font color when the Category property is set to “Seafood”.

using DevExpress.ExpressApp.ConditionalAppearance;
//...
[Appearance("LayoutGroupColoredInDetailView", AppearanceItemType = "LayoutItem",
 TargetItems = "ProductParametersLayoutGroup", Criteria = "Category = 'Seafood'",
 Context = "Product_DetailView", FontColor = "Blue")]
public class Product : BaseObject {
    public Product(Session session) : base(session) { }
    public string Name {
        //...
    }
    public decimal Price {
        //...
    }
    public ProductStatus Status {
        //...
    }
    public Category Category {
        //...
    }
}
[DefaultProperty(nameof(Name))]
public class Category : BaseObject {
    public Category(Session session) : base(session) {}
    public string Name {
        //...
    }
}

You will find many examples demonstrated in the FeatureCenter demo installed with XAF. This demo is located in the %PUBLIC%\Documents\DevExpress Demos 20.2\Components\eXpressApp Framework\FeatureCenter folder by default.

See Also