DEV Community

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

Posted on

1

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

Image of Timescale

🚀 pgai Vectorizer: SQLAlchemy and LiteLLM Make Vector Search Simple

We built pgai Vectorizer to simplify embedding management for AI applications—without needing a separate database or complex infrastructure. Since launch, developers have created over 3,000 vectorizers on Timescale Cloud, with many more self-hosted.

Read more →

Top comments (0)

Billboard image

The Next Generation Developer Platform

Coherence is the first Platform-as-a-Service you can control. Unlike "black-box" platforms that are opinionated about the infra you can deploy, Coherence is powered by CNC, the open-source IaC framework, which offers limitless customization.

Learn more