Back to Devexpress

KeyAttribute Class

expressappframework-devexpress-dot-expressapp-dot-data.md

latest1.9 KB
Original Source

KeyAttribute Class

Applied to properties of non-persistent classes. Specifies that a target property is a key property.

Namespace : DevExpress.ExpressApp.Data

Assembly : DevExpress.ExpressApp.v25.2.dll

NuGet Package : DevExpress.ExpressApp

Declaration

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

Remarks

A Key property is required if you are going to access a non-persistent object by a key using the NonPersistentObjectSpace.ObjectByKeyGetting event. An example of using this event together with the KeyAttribute attribute is provided in the How to: Display a Non-Persistent Object’s Detail View from the Navigation topic.

Inheritance

Object Attribute KeyAttribute

See Also

KeyAttribute Members

DevExpress.ExpressApp.Data Namespace