# Data Annotation Attributes | WPF Controls | DevExpress Documentation

**Data Annotation** attributes are used for customizing data classes, to specify how data is displayed from a data source, define validation rules, and set relationships between data classes.

The [GridControl](/WPF/DevExpress.Xpf.Grid.GridControl), [TreeListControl](/WPF/DevExpress.Xpf.Grid.TreeListControl), [DataLayoutControl](/WPF/DevExpress.Xpf.LayoutControl.DataLayoutControl) and [PropertyGridControl](/WPF/DevExpress.Xpf.PropertyGrid.PropertyGridControl) recognize **Data Annotation** attributes, and automatically generate layout and content based on these attributes. These controls support the following attributes from the [System.ComponentModel.DataAnnotations](https://docs.microsoft.com/en-us/dotnet/api/system.componentmodel.dataannotations) library.

- CreditCardAttribute
- CustomValidationAttribute
- DataTypeAttribute
- DisplayAttribute
- DisplayFormatAttribute
- EditableAttribute
- EnumDataTypeAttribute
- EmailAddressAttribute
- FileExtensionsAttribute
- MaxLengthAttribute
- MetadataTypeAttribute
- MinLengthAttribute
- PhoneAttribute
- RangeAttribute
- RegularExpressionAttribute
- RequiredAttribute
- ScaffoldColumnAttribute
- ScaffoldTable
- StringLengthAttribute
- UrlAttribute
- ValidationAttribute

Additionally, the [DevExpress.Mvvm.DataAnnotations](/CoreLibraries/DevExpress.Mvvm.DataAnnotations) namespace contains the following attributes for setting masks.

- DateTimeMaskAttribute
- NumericMaskAttribute
- RegExMaskAttribute
- RegularMaskAttribute
- SimpleMaskAttribute
- DefaultEditorAttribute
- GridEditorAttribute
- LayoutControlEditorAttribute
- PropertyGridEditorAttribute

Note

**Data Annotation** attributes cannot be used to configure automatically generated data classes, for example, [WCF Data Services](https://docs.microsoft.com/en-us/dotnet/framework/data/wcf/wcf-data-services-overview).

You can use the **Data Annotation Attributes** in [POCO View models](/WPF/17352/mvvm-framework/viewmodels/runtime-generated-poco-viewmodels#idataerrorinfo) to implement the [IDataErrorInfo](https://learn.microsoft.com/dotnet/api/system.componentmodel.idataerrorinfo) interface.

See Also

[WPF Data Grid - Apply Data Annotations](/WPF/8834/controls-and-libraries/data-grid/grid-view-data-layout/columns-and-card-fields/applying-data-annotations)