The requested page is not available for the requested platform. You are viewing the content for .NET Framework 4.5.2+ platform.
.NET Framework 4.5.2+
.NET Framework 4.5.2+
.NET Standard 2.0+

MemberDesignTimeVisibilityAttribute Class

Specifies whether a property or class is visible at design time.

Namespace: DevExpress.Xpo

Assembly: DevExpress.Xpo.v19.1.dll

Declaration

[AttributeUsage(AttributeTargets.Class | AttributeTargets.Property | AttributeTargets.Field, Inherited = true)]
public sealed class MemberDesignTimeVisibilityAttribute : Attribute
<AttributeUsage(AttributeTargets.Class Or AttributeTargets.Property Or AttributeTargets.Field, Inherited:=True)>
Public NotInheritable Class MemberDesignTimeVisibilityAttribute
    Inherits Attribute
[AttributeUsage(AttributeTargets.Class | AttributeTargets.Field | AttributeTargets.Property, Inherited = true)]
public sealed class MemberDesignTimeVisibilityAttribute : Attribute
<AttributeUsage(AttributeTargets.Class Or AttributeTargets.Field Or AttributeTargets.Property, Inherited:=True)>
Public NotInheritable Class MemberDesignTimeVisibilityAttribute
    Inherits Attribute

Remarks

The MemberDesignTimeVisibilityAttribute attribute specifies whether a class or property is marked as visible by default. This attribute affects the collection's behavior while it is bound to a control (see the example).

Examples

The following example shows how to mark the Age property as hidden at design time. For this purpose the MemberDesignTimeVisibilityAttribute is used. When binding the xpCollection1 class to the XtraGrid control, grid columns are automatically created for displayable properties. As a result the column for the Age property isn't created.

MemberDTimeVisibility

using DevExpress.Xpo;
// ...
class SampleTable : XPBaseObject {
    private int id;
    private string name;
    private int age;

    SampleTable(Session session) : base(session) {
        this.name = "John";
        this.age = 25;
    }

    [Key(true)]
    public int ID {
        get { return id; }
        set { SetPropertyValue<int>("ID", ref id, value); }
    }
    public string Name {
        get { return name; }
        set { SetPropertyValue<string>("Name", ref name, value); }
    }
    [MemberDesignTimeVisibility(false)]
    public int Age {
        get { return age; }
        set { SetPropertyValue<int>("Age", ref age, value); }
    }
}

Inheritance

Object
Attribute
MemberDesignTimeVisibilityAttribute
See Also