Skip to main content
.NET Framework 4.5.2+

AppearanceAttribute.TargetItems Property

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

Namespace: DevExpress.ExpressApp.ConditionalAppearance

Assembly: DevExpress.Persistent.Base.v24.1.dll

Declaration

public string TargetItems { get; set; }

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 virtual string Name { get; set; }
    public virtual decimal Price { get; set; }
    public virtual ProductStatus Status { get; set; }
    public virtual Category Category { get; set; }
}

[DefaultProperty(nameof(Name))]
public class Category : BaseObject {
    public virtual string Name { get; set; }
}

// Make sure that you use options.UseChangeTrackingProxies() in your DbContext settings.

Implements

See Also