Formatting the DataGrid

The DataGrid control can be formatted using many of the techniques mentioned already in this hour. All of the built-in style properties discussed for the DataList are still accessible with the DataGrid with one addition: Because it is possible to edit content directly in the DataGrid, the DataGrid also has a style named EditItemStyle. You can use this to change the appearance of the row currently being modified by a user.

In addition to this type of formatting, you can also tell the DataGrid control to not generate columns automatically and work with the columns directly. This is normally a wise choice; though the automatically generated columns are handy, they will rarely, if ever, be a good choice for a production application. ...

Get Sams Teach Yourself ADO.NET in 24 Hours 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.