Represents a collection of System.Web.UI.WebControls.DataKey objects. This class cannot be inherited.
See Also: DataKeyArray Members
The System.Web.UI.WebControls.DataKeyArray class is used to store and manage a collection of System.Web.UI.WebControls.DataKey objects. A System.Web.UI.WebControls.DataKey object represents the primary key of a record in a data-bound control. In general, data-bound controls that display multiple records (such as the System.Web.UI.WebControls.GridView control) use a System.Web.UI.WebControls.DataKeyArray object to store the System.Web.UI.WebControls.DataKey objects for the records displayed in the control.
The System.Web.UI.WebControls.DataKeyArray class supports several ways to access the items in the collection:
Use the DataKeyArray.Item(int) indexer to directly retrieve a System.Web.UI.WebControls.DataKey object from the collection at a specific zero-based index.
Use the DataKeyArray.GetEnumerator method to retrieve an enumerator that can be used to iterate through the collection.
Use the DataKeyArray.CopyTo(DataKey[], int) 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 DataKeyArray.Count property.