DEV Community

Cover image for How to Customize the Rows of ASP.NET Core DataGrid using Templates
Arun for Syncfusion, Inc.

Posted on

How to Customize the Rows of ASP.NET Core DataGrid using Templates

Learn how to customize rows in the Syncfusion ASP.NET Core DataGrid using templates. You’ll also learn how to use a detail template to show additional information about a particular grid row by expanding or collapsing it.

The ASP.NET Core DataGrid is a feature-rich control for displaying data in a tabular format. Its various functionalities include data binding, editing, Excel-like filtering, aggregating rows, custom sorting, selection, and support for Excel, CSV, and PDF formats. You can bind data seamlessly from various local and remote data sources such as JSON, OData, WCF, and RESTful web services with the help of a data manager. The data manager lets users perform create, read, update, and delete operations (CRUD) easily with a list of business objects or remote data service.

The DataGrid provides a way to use a custom layout for its rows using the template feature. The rowTemplate property accepts either strings or the HTML element`s ID value, which will be used as the template for the row.

In this video, we present employee information with employee photos in the first column and employee details like name and address in the second column. The detail row template provides additional information about a data row, which can be shown or hidden by clicking the expand or collapse buttons.

The detailTemplate property accepts either strings or the HTML element`s ID value, which will be used as the template for the detail row. In this video, we present employee information with images in the detail row.

Tutorial video: https://www.syncfusion.com/tutorial-videos

Download an example from GitHub: https://github.com/SyncfusionExamples/how-to-customize-the-rows-of-aspdotnet-core-datagrid-using-templates

Top comments (0)