This sample demonstrates the data annotation feature of the Grid component.
DataGrid is a generic component that can be strongly bound to any business object via data annotation.
Data annotation is used to change the display format, validate fields by checking end-user input, and display messages to them by defining rules in model classes.
The user must import the namespace System.ComponentModel.DataAnnotations before using the data annotation. Users can change the Display Format, Header text of the Column, Editable, and set any one of the columns should be defined as a primary key using the
IsPrimaryKey property for a specific field using the data annotation attributes.
The DataGrid in this demo had been modified as follows.
More information about the Data annotation feature can be found in this documentation section.