System.Web.UI.WebControls Namespace
.NET Framework version 2.0
Represents the collection of Rows in a GridView control.
The GridViewRowCollection class represents a collection of GridViewRow objects, that in turn represent the data rows displayed in a GridView control. To programmatically retrieve GridViewRow objects from a GridView control, use one of following methods:
- Use the indexer to get a single GridViewRow from the collection, using array notation.
- Use the CopyTo method to copy the contents of the collection to a System.Array object, which can then be used to get rows from the collection.
- Use the GetEnumerator method to create a System.Collections.IEnumerator implemented object, which can then be used to get rows from the collection.
The Count property specifies the total number of rows in the collection, and is commonly used to determine the upper bound of the collection.
NOTE: The GridViewRowCollection is read-only; as such, it does not provide any methods to add or remove rows in the collection.
GridView GridView.Rows GridViewRow