.NET Framework 4.5.2+
.NET Framework 4.5.2+
.NET Standard 2.0+
.NET Core 3.0+

AppearanceAttribute.TargetItems Property

Specifies the identifiers of UI elements affected by the conditional appearance rule.

Namespace: DevExpress.ExpressApp.ConditionalAppearance

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

Declaration

public string TargetItems { get; set; }
Public Property TargetItems As String
public string TargetItems { get; set; }
Public Property TargetItems As String
public string TargetItems { get; set; }
Public Property TargetItems As String

Property Value

Type Description
String

A string consisting of is semicolon separated identifiers of the UI elements affected by the conditional appearance rule.

Property Value

Type Description
String

A string consisting of is semicolon separated identifiers of the UI elements affected by the conditional appearance rule.

Property Value

Type Description
String

A string consisting of is semicolon separated identifiers of the UI elements affected by the conditional appearance rule.

Remarks

In Detail Views, identifiers, passed to the TargetItems property are Id property values of the Application Model nodes that correspond to the UI elements (e.g., IModelMember, IModelLayoutItem, IModelAction, etc.). In List Views, these identifiers are property names.

You can specify several UI elements of the type specified via the IAppearanceRuleProperties.AppearanceItemType property to be affected by the conditional appearance rule. See the possible variants for specifying the TargetItems value in the following table:

Example Description
"TargetElementId" An identifier of the individual target element. The element with the "TargetElementId" identifier is affected.
"TargetElementId1;TargetElementId2" A semicolon-separated list of target element identifiers. The listed elements are affected.
"*" An asterisk (*) wildcard. All elements are affected.
"*;TargetElementId1;TargetElementId2" An asterisk (*) wildcard, followed by a semicolon-separated list of target element identifiers. All elements, except for those listed, are affected.
Note

You cannot specify "all Actions" via the "*" wildcard. To specify several Actions, list their identifiers explicitly. When the AppearanceItemType is Action, the asterisk sign is interpreted as a reference to an Action that has the "*" identifier.

Example

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