Understanding DataGrid Properties
Like all ASP.NET server controls, the DataGrid exposes a rich set of properties and methods. In the previous chapter, you worked with a few of these properties and methods, including the DataSource property and the DataBind() method. You built DataGrids that were rendered as basic HTML <table> elements. Although this is where the core functionality of the DataGrid is found, the table that was rendered wasn't the most attractive table ever. Altering the DataGrid's appearance is as simple as setting a few property values. You can be as creative as you like because the property set accounts for nearly everything you'll want.
Listing 6.1 builds a DataGrid that renders a plain old table. The following examples will ...
Get Programming Data-Driven Web Applications with ASP.NET 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.