Export (0) Print
Expand All
This topic has not yet been rated - Rate this topic

DataGridView.DataGridViewControlCollection Class

Represents a collection of controls contained on a DataGridView.

Namespace:  System.Windows.Forms
Assembly:  System.Windows.Forms (in System.Windows.Forms.dll)
[ComVisibleAttribute(false)]
public class DataGridViewControlCollection : Control.ControlCollection

The DataGridView.DataGridViewControlCollection type exposes the following members.

  NameDescription
Public methodDataGridView.DataGridViewControlCollectionInitializes a new instance of the DataGridView.DataGridViewControlCollection class.
Top
  NameDescription
Public propertyCountGets the number of elements in the collection. (Inherited from ArrangedElementCollection.)
Public propertyIsReadOnlyGets a value indicating whether the collection is read-only. (Inherited from ArrangedElementCollection.)
Public propertyItem[Int32]Indicates the Control at the specified indexed location in the collection. (Inherited from Control.ControlCollection.)
Public propertyItem[String]Indicates a Control with the specified key in the collection. (Inherited from Control.ControlCollection.)
Public propertyOwnerGets the control that owns this Control.ControlCollection. (Inherited from Control.ControlCollection.)
Top
  NameDescription
Public methodAddAdds the specified control to the control collection. (Inherited from Control.ControlCollection.)
Public methodAddRangeAdds an array of control objects to the collection. (Inherited from Control.ControlCollection.)
Public methodClearRemoves all controls from the DataGridView. (Overrides Control.ControlCollection.Clear().)
Public methodContainsDetermines whether the specified control is a member of the collection. (Inherited from Control.ControlCollection.)
Public methodContainsKeyDetermines whether the Control.ControlCollection contains an item with the specified key. (Inherited from Control.ControlCollection.)
Public methodCopyTo(Array, Int32)Copies the entire contents of this collection to a compatible one-dimensional Array, starting at the specified index of the target array. (Inherited from ArrangedElementCollection.)
Public methodCopyTo(Control[], Int32)Copies the contents of the DataGridView.DataGridViewControlCollection into a Control array, starting at the specified index of the target array.
Public methodEqualsDetermines whether two ArrangedElementCollection instances are equal. (Inherited from ArrangedElementCollection.)
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 methodFindSearches for controls by their Name property and builds an array of all the controls that match. (Inherited from Control.ControlCollection.)
Public methodGetChildIndex(Control)Retrieves the index of the specified child control within the control collection. (Inherited from Control.ControlCollection.)
Public methodGetChildIndex(Control, Boolean)Retrieves the index of the specified child control within the control collection, and optionally raises an exception if the specified control is not within the control collection. (Inherited from Control.ControlCollection.)
Public methodGetEnumeratorRetrieves a reference to an enumerator object that is used to iterate over a Control.ControlCollection. (Inherited from Control.ControlCollection.)
Public methodGetHashCodeReturns the hash code for this instance. (Inherited from ArrangedElementCollection.)
Public methodGetTypeGets the Type of the current instance. (Inherited from Object.)
Public methodIndexOfRetrieves the index of the specified control in the control collection. (Inherited from Control.ControlCollection.)
Public methodIndexOfKeyRetrieves the index of the first occurrence of the specified item within the collection. (Inherited from Control.ControlCollection.)
Public methodInsertInserts the specified Control into the DataGridView.DataGridViewControlCollection at the specified index.
Protected methodMemberwiseCloneCreates a shallow copy of the current Object. (Inherited from Object.)
Public methodRemoveRemoves the specified control from the DataGridView.DataGridViewControlCollection. (Overrides Control.ControlCollection.Remove(Control).)
Public methodRemoveAtRemoves a control from the control collection at the specified indexed location. (Inherited from Control.ControlCollection.)
Public methodRemoveByKeyRemoves the child control with the specified key. (Inherited from Control.ControlCollection.)
Public methodSetChildIndexSets the index of the specified child control in the collection to the specified index value. (Inherited from Control.ControlCollection.)
Public methodToStringReturns a string that represents the current object. (Inherited from Object.)
Top
  NameDescription
Explicit interface implemetationPrivate methodICloneable.CloneInfrastructure. For a description of this member, see ICloneable.Clone. (Inherited from Control.ControlCollection.)
Explicit interface implemetationPrivate propertyICollection.IsSynchronizedFor a description of this member, see the ICollection.IsSynchronized property. (Inherited from ArrangedElementCollection.)
Explicit interface implemetationPrivate propertyICollection.SyncRootFor a description of this member, see the ICollection.SyncRoot property. (Inherited from ArrangedElementCollection.)
Explicit interface implemetationPrivate methodIList.AddInfrastructure. For a description of this member, see IList.Add. (Inherited from Control.ControlCollection.)
Explicit interface implemetationPrivate methodIList.ClearFor a description of this member, see the IList.Clear method. (Inherited from ArrangedElementCollection.)
Explicit interface implemetationPrivate methodIList.ContainsFor a description of this member, see the IList.Contains method. (Inherited from ArrangedElementCollection.)
Explicit interface implemetationPrivate methodIList.IndexOfFor a description of this member, see the IList.IndexOf method. (Inherited from ArrangedElementCollection.)
Explicit interface implemetationPrivate methodIList.InsertFor a description of this member, see the IList.Insert method. (Inherited from ArrangedElementCollection.)
Explicit interface implemetationPrivate propertyIList.IsFixedSizeFor a description of this member, see the IList.IsFixedSize property. (Inherited from ArrangedElementCollection.)
Explicit interface implemetationPrivate propertyIList.ItemFor a description of this member, see the IList.Item property. (Inherited from ArrangedElementCollection.)
Explicit interface implemetationPrivate methodIList.RemoveInfrastructure. For a description of this member, see IList.Remove. (Inherited from Control.ControlCollection.)
Explicit interface implemetationPrivate methodIList.RemoveAtFor a description of this member, see the IList.RemoveAt method. (Inherited from ArrangedElementCollection.)
Top

The Controls property of the DataGridView control returns an instance of type Control.ControlCollection which you can cast to an instance of type DataGridView.DataGridViewControlCollection.

The DataGridView.DataGridViewControlCollection includes controls such as the editing control and the scrollbars on the DataGridView.

.NET Framework

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

.NET Framework Client Profile

Supported in: 4, 3.5 SP1

Windows Phone 8.1, Windows Phone 8, 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.
Did you find this helpful?
(1500 characters remaining)
Thank you for your feedback
Show:
© 2014 Microsoft. All rights reserved.