DetailsView::Rows Property
Gets a collection of DetailsViewRow objects that represent the data rows in a DetailsView control.
Assembly: System.Web (in System.Web.dll)
public: [BrowsableAttribute(false)] property DetailsViewRowCollection^ Rows { virtual DetailsViewRowCollection^ get(); }
Property Value
Type: System.Web.UI.WebControls::DetailsViewRowCollection^A DetailsViewRowCollection that contains all the data rows in a DetailsView control.
The Rows property (collection) is used to store the data rows in a DetailsView control. The DetailsView control automatically populates the Rows collection by creating a DetailsViewRow object for each record in the data source and then adding the object to the collection. This property is commonly used to access a specific row in the control or to iterate though the entire collection of rows.
Note |
|---|
Only data rows are stored in the Rows collection. The DetailsViewRow objects that represent the header, footer, and pager rows are not included in the collection. |
The following code example demonstrates how to use the Rows property to access a data row in a DetailsView control. The data row is used to retrieve the value of a field from the DetailsView control.
Available since 2.0
