Assembly: System.Web (in System.Web.dll)
The class represents a collection of DataControlField objects used by data-bound controls to specify how their child controls are presented. The class derives from StateManagedCollection, an abstract base collection class used specifically to store IStateManager objects.
A StateManagedCollection object influences the behavior of a object. DataControlField objects that are dynamically added to the collection will be re-added to the control when state is restored. This means that a field must be added, removed, or changed just once instead of on each postback, the way most collection types in ASP.NET require.
Use the class to programmatically manage a set of DataControlField objects. Note that it is more common to define these fields declaratively.
You can add, insert, and remove DataControlField objects using the appropriate methods of the class. To programmatically retrieve DataControlField objects from a collection, use one of following methods:
Use the indexer to get a single DataControlField object from the collection using array notation.
The Count property specifies the total number of items in the collection, and is commonly used to determine the upper bound of the collection. You can add items to and remove items from the collection using the Add, Insert, Remove, and RemoveAt methods.
If you are using the GridView or DetailsView control, the DataControlField objects that are automatically created (for example, when the AutoGenerateColumns property is true) are not stored in the publicly accessible fields collection. You can only access and manipulate DataControlField objects that are not automatically generated.
The following table lists the different data control field classes and how they are used.
The abstract base class for all fields.
A data-bound control field that is used to bind to text or data retrieved from an ASP.NET data source control.
A data-bound control field that displays at least one button.
A data-bound control field that displays a CheckBox control.
A data-bound control field that displays actions that can be performed on the data displayed by the row (or column), such as edit, update, or delete.
A data-bound control field that displays a HyperLink control.
A data-bound control field that displays an Image control.
A data-bound control field that displays custom content in a data-bound control.
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.