DataKeyArray Class
Represents a collection of DataKey objects. This class cannot be inherited.
Assembly: System.Web (in System.Web.dll)
| Name | Description | |
|---|---|---|
![]() | DataKeyArray(ArrayList) | Initializes a new instance of the DataKeyArray class. |
| Name | Description | |
|---|---|---|
![]() | Count | Gets the number of items in the collection. |
![]() | IsReadOnly | Gets a value indicating whether the items in the collection can be modified. |
![]() | IsSynchronized | Gets a value indicating whether the DataKeyArray collection is synchronized (thread safe). |
![]() | Item(Int32) | Gets the DataKey object from the collection at the specified index. |
![]() | SyncRoot | Gets the object used to synchronize access to the collection. |
| Name | Description | |
|---|---|---|
![]() | CopyTo(DataKey[], Int32) | Copies all the items from this collection to the specified array of DataKey objects, starting at the specified index in the array. |
![]() | Equals(Object) | Determines whether the specified object is equal to the current object.(Inherited from Object.) |
![]() | GetEnumerator() | Returns an enumerator that contains all DataKey objects in the collection. |
![]() | GetHashCode() | Serves as the default hash function. (Inherited from Object.) |
![]() | GetType() | |
![]() | ToString() | Returns a string that represents the current object.(Inherited from Object.) |
| Name | Description | |
|---|---|---|
![]() ![]() | ICollection.CopyTo(Array, Int32) | This API supports the product infrastructure and is not intended to be used directly from your code. Copies all the items from this collection to the specified System.Array, starting at the specified index in the System.Array. |
![]() ![]() | IStateManager.LoadViewState(Object) | This API supports the product infrastructure and is not intended to be used directly from your code. Loads the previously saved view state of the DataKeyArray object. |
![]() ![]() | IStateManager.SaveViewState() | This API supports the product infrastructure and is not intended to be used directly from your code. Saves the current view state of the DataKeyArray object. |
![]() ![]() | IStateManager.TrackViewState() | This API supports the product infrastructure and is not intended to be used directly from your code. Marks the starting point at which to begin tracking and saving view-state changes to the DataKeyArray object. |
![]() ![]() | IStateManager.IsTrackingViewState | This API supports the product infrastructure and is not intended to be used directly from your code. Gets a value indicating whether the DataKeyArray object is tracking its view-state changes. |
| Name | Description | |
|---|---|---|
![]() | AsParallel() | Overloaded. Enables parallelization of a query.(Defined by ParallelEnumerable.) |
![]() | AsQueryable() | Overloaded. Converts an IEnumerable to an IQueryable.(Defined by Queryable.) |
![]() | Cast<'TResult>() | Casts the elements of an IEnumerable to the specified type.(Defined by Enumerable.) |
![]() | OfType<'TResult>() | Filters the elements of an IEnumerable based on a specified type.(Defined by Enumerable.) |
The DataKeyArray class is used to store and manage a collection of DataKey objects. A 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 GridView control) use a DataKeyArray object to store the DataKey objects for the records displayed in the control.
The DataKeyArray class supports several ways to access the items in the collection:
Use the Item indexer to directly retrieve a DataKey object from the collection at a specific zero-based index.
Use the GetEnumerator method to retrieve an enumerator that can be used to iterate through the collection.
Use the CopyTo 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 Count property.
The following code example demonstrates how to use the indexer to retrieve a DataKey object from a DataKeyArray collection.
The following code example demonstrates how to iterate through a DataKeyArray collection.
Available since 2.0
Any public static ( Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.




