.NET Framework 4.5.2+
.NET Framework 4.5.2+
.NET Standard 2.0+
.NET 5.0+

AppearanceAttribute(String) Constructor

Creates a new instance of the AppearanceAttribute class.

Namespace: DevExpress.ExpressApp.ConditionalAppearance

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

Declaration

public AppearanceAttribute(
    string id
)

Parameters

Name Type Description
id String

A string that is the unique identifier for the appearance rule created using the current attribute instance.

Remarks

This constructor sets the following attribute properties:

The remaining properties can be specified using the constructor’s named parameters.

To learn how to define a rule using the Appearance attribute, refer to the Declare Conditional Appearance Rules in Code topic.

Example

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 {
        //...
    }
}

The following code snippets (auto-collected from DevExpress Examples) contain references to the AppearanceAttribute(String) constructor.

Note

The algorithm used to collect these code examples remains a work in progress. Accordingly, the links and snippets below may produce inaccurate results. If you encounter an issue with code examples below, please use the feedback form on this page to report the issue.

See Also