Chapter 1. Tabular Data

Introduction

When it comes to displaying tabular data, ASP.NET can save you a lot of time, provided you play your cards right. If you want to display data from a database in a table and you’re not concerned about performance or your ability to control the arrangement of the data items within the display, you can whip up something with the DataGrid control in mere minutes using relatively few lines of code. Alternatively, if you’re more inclined to control nearly every aspect of the tabular display, you can shape and mold the template-driven Repeater and DataList controls nearly beyond recognition, and still not step very far outside a well-trodden path. But like everything else in ASP.NET, you have to know where to start and what the trade-offs are. For instance, it’s helpful to know how and when the DataGrid control begins to fall short of the mark. That knowledge will save you having to retrace your steps later to implement another tabular control altogether, something we’ve had to do ourselves at an inopportune moment during a hot project. The recipes in this chapter ought to get you well down the curve with displaying your tabular data and prevent you having to revisit some of our same mistakes.

Get ASP.NET Cookbook now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.