System.Web.UI.WebControls Namespace
Represents an individual item in a DataGrid control.
A DataGridItem represents a single item or row in the DataGrid control.
The DataGrid control stores its contents in basically two collections. These collections are exposed via the DataGrid.Controls and DataGrid.Items properties. Both properties return a collection of DataGridItem objects that represent the individual items in the DataGrid, though the contents of the collections differ slightly.
DataGrid.Controls returns a ControlCollection object that contains every item in the DataGrid that is treated as a control, including the header and footer, while DataGrid.Items returns a DataGridItemCollection that contains only the data-bound items in the control.
For example, in a DataGrid bound to a data source with three records, DataGrid.Controls will return a collection consisting of five DataGridItem objects: one each for the header and footer, and one for each record ( or row of data ) in the data source. DataGrid.Items on the other hand will return a collection consisting of three DataGridItem objects, each corresponding to a record ( or row of data ) in the data source.
You can use the DataGridItem object to gain access to the properties of each item or control in the DataGrid, as well as the properties of the child controls associated with each item or control.
For examples illustrating use of this control, see the individual member types of this class.
DataGrid.Controls DataGrid.Items