Column Types

A DataGrid control is formed by data bound columns. The control has the ability to automatically generate columns that are based on the structure of the data source. Auto-generation is the default behavior, but you can manipulate that behavior by using a Boolean property named AutoGenerateColumns. Set the property to false when you want the control to display only the columns you explicitly add to the Columns collection. Set it to true (the default) when you want the control to add as many columns as is required by the data source. The default algorithm for column generation creates simple data bound columns that use literal controls to display the contents of the corresponding data source fields. The DataGrid control supports additional ...

Get Building Web Solutions with ASP.NET and ADO.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.