Assembly: System.Web (in System.Web.dll)
[<PersistenceModeAttribute(PersistenceMode.InnerProperty)>] abstract Fields : DataControlFieldCollection with get [<PersistenceModeAttribute(PersistenceMode.InnerProperty)>] override Fields : DataControlFieldCollection with get
Property ValueType: System.Web.UI.WebControls.DataControlFieldCollection
When you explicitly declare the row fields for a DetailsView control, these row fields are stored in the property (collection). The collection also allows you to programmatically manage the collection of explicitly declared rows.
Explicitly declared row fields can be used in combination with automatically generated row fields. When both are used, explicitly declared row fields are rendered first, followed by the automatically generated row fields. Automatically generated row fields are not added to thecollection.
Different row field types determine the behavior of the rows in the control. The following table shows the different row field types that can be used in thecollection.
Row field type
Displays the value of a field in a data source as text.
Displays a command button in the DetailsView control. This allows you to display a row with a custom button control, such as an Add or a Remove button.
Displays a check box in the DetailsView control. This row field type is commonly used to display fields with a Boolean value.
Displays built-in command buttons to perform edit, insert, or delete operations in the DetailsView control.
Displays the value of a field in a data source as a hyperlink. This row field type allows you to bind a second field to the hyperlink's URL.
Displays an image in the DetailsView control.
Displays user-defined content for a row in the DetailsView control according to a specified template. This row field type allows you to create a custom row field.
To explicitly declare the row fields for a DetailsView control, first set the AutoGenerateRows property to false. Next, add opening and closing <Fields> tags between the opening and closing tags of the DetailsView control. Finally, list the row fields that you want to include between the opening and closing <Fields> tags. The row fields are displayed in the DetailsView control in the order that the row fields appear in the collection.
If the Visible property of a row field is set to false, the row is not displayed in the DetailsView control and the data for the row does not make a round trip to the client. If you want the data for a row that is not visible to make a round trip, add the field name to the DataKeyNames property.
Available since 2.0