System.Web.UI.WebControls.AutoGeneratedField Class

Represents an automatically generated field in a data-bound control. This class cannot be inherited.

See Also: AutoGeneratedField Members

Syntax

[System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)]
public sealed class AutoGeneratedField : BoundField

Remarks

The System.Web.UI.WebControls.AutoGeneratedField class is used to represent an automatically generated field in a data-bound control, such as System.Web.UI.WebControls.GridView or System.Web.UI.WebControls.DetailsView. Automatically generated fields are created by a data-bound control when the appropriate property is set to true (for example, the GridView.AutoGenerateColumns property for the System.Web.UI.WebControls.GridView control, the DetailsView.AutoGenerateRows property for the System.Web.UI.WebControls.DetailsView control, and so on).

Note:

Automatically generated fields are not added to the field collection of a data-bound control (for example, the GridView.Columns collection for the System.Web.UI.WebControls.GridView control, the DetailsView.Fields collection for the System.Web.UI.WebControls.DetailsView control, and so on).

The System.Web.UI.WebControls.AutoGeneratedField class is intended for use internally by data-bound controls. Unlike other data fields (such as System.Web.UI.WebControls.BoundField, System.Web.UI.WebControls.CheckBoxField, System.Web.UI.WebControls.TemplateField, and so on), the System.Web.UI.WebControls.AutoGeneratedField class cannot be placed declaratively on a page as part of a field collection. Although you can programmatically add an System.Web.UI.WebControls.AutoGeneratedField object to a field collection, this design pattern should be avoided.

Because automatically generated fields represent the automatic rendering of a field, data-bound controls do not typically allow users to modify the properties of the System.Web.UI.WebControls.AutoGeneratedField objects. If the automatic rendering is not suitable for your needs, define your own data fields for the field collection of the control.

Requirements

Namespace: System.Web.UI.WebControls
Assembly: System.Web (in System.Web.dll)
Assembly Versions: 2.0.0.0
Since: .NET 2.0