Skip to main content
.NET Framework 4.6.2+

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

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.v24.2.dll

NuGet Package: DevExpress.ExpressApp

#Declaration

[AttributeUsage(AttributeTargets.Property | AttributeTargets.Field, AllowMultiple = false, Inherited = true)]
public class KeyAttribute :
    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