Skip to main content
.NET 8.0+

DevExpress v24.2 Update — Your Feedback Matters

Our What's New in v24.2 webpage includes product-specific surveys. Your response to our survey questions will help us measure product satisfaction for features released in this major update and help us refine our plans for our next major release.

Take the survey Not interested

AppearanceAttribute.Enabled Property

Specifies whether to enable UI elements affected by the conditional appearance rule generated from this attribute instance.

Namespace: DevExpress.ExpressApp.ConditionalAppearance

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

#Declaration

public bool Enabled { get; set; }

#Property Value

Type Description
Boolean

true, if UI elements affected by the conditional appearance rule must be enabled; otherwise, false.

#Remarks

The following UI elements can be made disabled/enabled:

  • Data cells in a GridListEditor and ASPxGridListEditor when switching to the inline editing mode
  • Property Editors that are inherited from the PropertyEditor class.
  • Actions

You can find many examples in the Declare Conditional Appearance Rules in Code topic. See these examples in the Feature Center demo installed with the XAF in the %PUBLIC%\Documents\DevExpress Demos 24.2\Components\XAF\FeatureCenter.NETFramework.XPO folder, or refer to the Feature Center demo online.

The example below demonstrates how to disable the NickName property editor in the Contact Detail View.

using System;
using DevExpress.ExpressApp;
using DevExpress.ExpressApp.Actions;
using DevExpress.Persistent.Base;
// ...
public class Contact : BaseObject {
    // ...
    [Appearance("NickNameDisabled", Context = "Contact_DetailView", AppearanceItemType = "ViewItem", Enabled = false)]
    public virtual string NickName { get; set; }
}

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