Export (0) Print
Expand All

DataGridViewCellCollection Class

Represents a collection of cells in a DataGridViewRow.

System.Object
  System.MarshalByRefObject
    System.Windows.Forms.BaseCollection
      System.Windows.Forms.DataGridViewCellCollection

Namespace:  System.Windows.Forms
Assembly:  System.Windows.Forms (in System.Windows.Forms.dll)

[ListBindableAttribute(false)]
public class DataGridViewCellCollection : BaseCollection, 
	IList, ICollection, IEnumerable

The DataGridViewCellCollection type exposes the following members.

  NameDescription
Public methodDataGridViewCellCollectionInitializes a new instance of the DataGridViewCellCollection class.
Top

  NameDescription
Public propertyCountGets the total number of elements in the collection. (Inherited from BaseCollection.)
Public propertyIsReadOnlyGets a value indicating whether the collection is read-only. (Inherited from BaseCollection.)
Public propertyIsSynchronizedGets a value indicating whether access to the ICollection is synchronized. (Inherited from BaseCollection.)
Public propertyItem[Int32]Gets or sets the cell at the provided index location. In C#, this property is the indexer for the DataGridViewCellCollection class.
Public propertyItem[String]Gets or sets the cell in the column with the provided name. In C#, this property is the indexer for the DataGridViewCellCollection class.
Protected propertyListGets an ArrayList containing DataGridViewCellCollection objects. (Overrides BaseCollection.List.)
Public propertySyncRootGets an object that can be used to synchronize access to the BaseCollection. (Inherited from BaseCollection.)
Top

  NameDescription
Public methodAddAdds a cell to the collection.
Public methodAddRangeAdds an array of cells to the collection.
Public methodClearClears all cells from the collection.
Public methodContainsDetermines whether the specified cell is contained in the collection.
Public methodCopyTo(Array, Int32)Copies all the elements of the current one-dimensional Array to the specified one-dimensional Array starting at the specified destination Array index. (Inherited from BaseCollection.)
Public methodCopyTo(DataGridViewCell[], Int32)Copies the entire collection of cells into an array at a specified location within the array.
Public methodCreateObjRefCreates an object that contains all the relevant information required to generate a proxy used to communicate with a remote object. (Inherited from MarshalByRefObject.)
Public methodEquals(Object)Determines whether the specified object is equal to the current object. (Inherited from Object.)
Protected methodFinalizeAllows an object to try to free resources and perform other cleanup operations before it is reclaimed by garbage collection. (Inherited from Object.)
Public methodGetEnumeratorGets the object that enables iterating through the members of the collection. (Inherited from BaseCollection.)
Public methodGetHashCodeServes as the default hash function. (Inherited from Object.)
Public methodGetLifetimeServiceRetrieves the current lifetime service object that controls the lifetime policy for this instance. (Inherited from MarshalByRefObject.)
Public methodGetTypeGets the Type of the current instance. (Inherited from Object.)
Public methodIndexOfReturns the index of the specified cell.
Public methodInitializeLifetimeServiceObtains a lifetime service object to control the lifetime policy for this instance. (Inherited from MarshalByRefObject.)
Public methodInsertInserts a cell into the collection at the specified index.
Protected methodMemberwiseClone()Creates a shallow copy of the current Object. (Inherited from Object.)
Protected methodMemberwiseClone(Boolean)Creates a shallow copy of the current MarshalByRefObject object. (Inherited from MarshalByRefObject.)
Protected methodOnCollectionChangedRaises the CollectionChanged event.
Public methodRemoveRemoves the specified cell from the collection.
Public methodRemoveAtRemoves the cell at the specified index.
Public methodToStringReturns a string that represents the current object. (Inherited from Object.)
Top

  NameDescription
Public eventCollectionChangedOccurs when the collection is changed.
Top

  NameDescription
Public Extension MethodAsParallelEnables parallelization of a query. (Defined by ParallelEnumerable.)
Public Extension MethodAsQueryableConverts an IEnumerable to an IQueryable. (Defined by Queryable.)
Public Extension MethodCast<TResult>Casts the elements of an IEnumerable to the specified type. (Defined by Enumerable.)
Public Extension MethodOfType<TResult>Filters the elements of an IEnumerable based on a specified type. (Defined by Enumerable.)
Top

  NameDescription
Explicit interface implemetationPrivate methodICollection.CopyToCopies the elements of the collection to the specified array, starting at the specified index.
Explicit interface implemetationPrivate propertyICollection.CountGets the number of elements contained in the collection.
Explicit interface implemetationPrivate propertyICollection.IsSynchronizedInfrastructure. Gets a value indicating whether access to the collection is synchronized (thread safe).
Explicit interface implemetationPrivate propertyICollection.SyncRootInfrastructure. Gets an object that can be used to synchronize access to the collection.
Explicit interface implemetationPrivate methodIEnumerable.GetEnumeratorInfrastructure. Returns an enumerator that iterates through a collection.
Explicit interface implemetationPrivate methodIList.AddInfrastructure. Adds an item to the collection.
Explicit interface implemetationPrivate methodIList.ClearInfrastructure. Clears the collection.
Explicit interface implemetationPrivate methodIList.ContainsDetermines whether the collection contains the specified value.
Explicit interface implemetationPrivate methodIList.IndexOfInfrastructure. Determines the index of a specific item in a collection.
Explicit interface implemetationPrivate methodIList.InsertInfrastructure. Inserts an item into the collection at the specified position.
Explicit interface implemetationPrivate propertyIList.IsFixedSizeInfrastructure. Gets a value indicating whether the collection has a fixed size.
Explicit interface implemetationPrivate propertyIList.IsReadOnlyInfrastructure. Gets a value indicating whether the collection has a fixed size.
Explicit interface implemetationPrivate propertyIList.ItemInfrastructure. Gets or sets the element at the specified index.
Explicit interface implemetationPrivate methodIList.RemoveInfrastructure. Removes the first occurrence of a specific object from the collection.
Explicit interface implemetationPrivate methodIList.RemoveAtInfrastructure. Removes the DataGridViewCell at the specified index.
Top

DataGridViewCellCollection objects are retrieved by the DataGridViewRow.Cells property.

.NET Framework

Supported in: 4.5.2, 4.5.1, 4.5, 4, 3.5, 3.0, 2.0

.NET Framework Client Profile

Supported in: 4, 3.5 SP1

Windows 8.1, Windows Server 2012 R2, Windows 8, Windows Server 2012, Windows 7, Windows Vista SP2, Windows Server 2008 (Server Core Role not supported), Windows Server 2008 R2 (Server Core Role supported with SP1 or later; Itanium not supported)

The .NET Framework does not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.

Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.
Show:
© 2014 Microsoft