DetailsViewRowCollection Class
Represents a collection of DetailsViewRow objects in a DetailsView control.
Assembly: System.Web (in System.Web.dll)
The DetailsViewRowCollection class is used to store and manage a collection of DetailsViewRow objects in a DetailsView control. Each row in a DetailsView control is represented by a DetailsViewRow object. The DetailsView control uses the DetailsViewRowCollection class for its Rows property.
Note: |
|---|
The Rows property contains only the data rows. To access the header row, footer row, top pager row, and bottom pager row, use the HeaderRow, FooterRow, TopPagerRow, and BottomPagerRow properties, respectively. |
The DetailsViewRowCollection class supports several ways to access the items in the collection:
Use the Item indexer to directly retrieve a DetailsViewRow object from the collection at a specific zero-based index.
Use the GetEnumerator method to retrieve an enumerator that can be used to iterate through the collection.
Use the CopyTo method to copy the items in the collection into an array, which can then be used to access the items in the collection.
To determine the total number of items in the collection, use the Count property.
The following code example demonstrates how to iterate through the DetailsViewRow objects in the Rows collection of a DetailsView control. The value of each row is then displayed on the page.
- AspNetHostingPermission
for operating in a hosted environment. Demand value: LinkDemand; Permission value: Minimal.
- AspNetHostingPermission
for operating in a hosted environment. Demand value: InheritanceDemand; Permission value: Minimal.
Windows 7, Windows Vista, Windows XP SP2, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP Starter Edition, Windows Server 2008 R2, Windows Server 2008, Windows Server 2003, Windows Server 2000 SP4, Windows Millennium Edition, Windows 98
The .NET Framework and .NET Compact Framework do not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.
Note: