The Data Grid was moved to maintenance support mode. No new features/capabilities will be added to this component. We recommend that you migrate to the Grid component.
First Name
|
Last Name
|
Title
|
Title Of Courtesy
|
Birth Date
|
Hire Date
|
Details
|
|
---|---|---|---|---|---|---|---|
Nancy | Davolio | Sales Representative | Ms. | 12/8/1978 | 5/1/2005 | ||
Andrew | Fuller | Vice President, Sales | Dr. | 2/19/1965 | 8/14/1992 | ||
Janet | Leverling | Sales Representative | Ms. | 8/30/1985 | 4/1/2002 | ||
Margaret | Peacock | Sales Representative | Mrs. | 9/19/1973 | 5/3/1993 | ||
Steven | Buchanan | Sales Manager | Mr. | 3/4/1955 | 10/17/1993 | ||
Michael | Suyama | Sales Representative | Mr. | 7/2/1981 | 10/17/1999 | ||
Robert | King | Sales Representative | Mr. | 5/29/1960 | 1/2/1994 | ||
Laura | Callahan | Inside Sales Coordinator | Ms. | 1/9/1985 | 3/5/2004 | ||
Anne | Dodsworth | Sales Representative | Ms. | 1/27/1980 | 11/15/2004 |
You can use the DisplayTemplate and EditTemplate properties to specify custom content for the column and its editor. Use the template's context parameter to access a data object and its fields.
When you use an edit template with complex dependencies between editors, you should call the CellEditContext.OnChanged method to inform the editors about changes in each other and save new cell values to the EditedValues collection. Then, the Data Grid passes this collection to the RowInserting and RowUpdating events.
This demo customizes the Details column. The display template shows the More Info... links. Users can click these links to view details about data rows in a pop-up window. The edit template embeds the Memo component into the edit form.
The Data Grid was moved to maintenance support mode. No new features/capabilities will be added to this component. We recommend that you migrate to the Grid component.
This demo illustrates how to use the Data Grid's RowPreviewTemplate property to show preview sections under each data row across all columns. These sections can display any content, such as tables, images, values from data source fields, custom text, and so on.
The template's Context parameter has the following properties:
- RowIndex — Returns a zero-based row index.
- DataItem — Returns a data item that corresponds to the row.
When you define the row preview template, use the Columns property to add Data Grid columns.