Back to Devexpress

DisplayNameAttribute Class

xpo-devexpress-dot-xpo-2507851d.md

latest1.9 KB
Original Source

DisplayNameAttribute Class

Specifies the member’s display name.

Namespace : DevExpress.Xpo

Assembly : DevExpress.Xpo.v25.2.dll

NuGet Package : DevExpress.Xpo

Declaration

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

Remarks

The following sample code shows how to use the DisplayNameAttribute attribute.

csharp
public class Customer : XPObject {

    private string _customerName;

    [DisplayName("Customer Name")]
    public string CustomerName {
        get { return _customerName; }
        set { _customerName = value; }
    }
}
vb
Public Class Customer
    Inherits XPObject

    Private _customerName As String

    <DisplayName("Customer Name")> _
    Public Property CustomerName() As String
        Get
            Return _customerName
        End Get
        Set(ByVal value As String)
            _customerName = value
        End Set
    End Property
End Class

Inheritance

Object Attribute DisplayNameAttribute

See Also

DisplayNameAttribute Members

Built-In Attributes

DevExpress.Xpo Namespace