DataGrid Control

The DataGrid control is a data-bound control that automatically displays a list of information in a series of rows and columns, as in a spreadsheet. A data-bound control is self-populating; that is, it fills itself with data when told the source of the data.

A DataGrid control must be bound to a data source using the DataSource and DataMember properties at design time or the SetDataBinding method at run time. Typically, a DataGrid control is bound to a DataTable, DataView or DataSet class (discussed in Chapter 13). However, you can also bind a DataGrid control to any class that implements the IList interface.

The ArrayList class, which we discussed in Chapter 6, implements the IList interface. In the GridDemo example, we will ...

Get Application Development Using Visual Basic® and .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.