DataGridViewRowCollection Class
TOC
Collapse the table of content
Expand the table of content

DataGridViewRowCollection Class

 

A collection of DataGridViewRow objects.

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

System.Object
  System.Windows.Forms.DataGridViewRowCollection

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

NameDescription
System_CAPS_pubmethodDataGridViewRowCollection(DataGridView)

Initializes a new instance of the DataGridViewRowCollection class.

NameDescription
System_CAPS_pubpropertyCount

Gets the number of rows in the collection.

System_CAPS_protpropertyDataGridView

Gets the DataGridView that owns the collection.

System_CAPS_pubpropertyItem[Int32]

Gets the DataGridViewRow at the specified index.

System_CAPS_protpropertyList

Gets an array of DataGridViewRow objects.

NameDescription
System_CAPS_pubmethodAdd()

Adds a new row to the collection.

System_CAPS_pubmethodAdd(DataGridViewRow)

Adds the specified DataGridViewRow to the collection.

System_CAPS_pubmethodAdd(Int32)

Adds the specified number of new rows to the collection.

System_CAPS_pubmethodAdd(Object[])

Adds a new row to the collection, and populates the cells with the specified objects.

System_CAPS_pubmethodAddCopies(Int32, Int32)

Adds the specified number of rows to the collection based on the row at the specified index.

System_CAPS_pubmethodAddCopy(Int32)

Adds a new row based on the row at the specified index.

System_CAPS_pubmethodAddRange(DataGridViewRow[])

Adds the specified DataGridViewRow objects to the collection.

System_CAPS_pubmethodClear()

Clears the collection.

System_CAPS_pubmethodContains(DataGridViewRow)

Determines whether the specified DataGridViewRow is in the collection.

System_CAPS_pubmethodCopyTo(DataGridViewRow[], Int32)

Copies the items from the collection into the specified DataGridViewRow array, starting at the specified index.

System_CAPS_pubmethodEquals(Object)

Determines whether the specified object is equal to the current object.(Inherited from Object.)

System_CAPS_protmethodFinalize()

Allows an object to try to free resources and perform other cleanup operations before it is reclaimed by garbage collection.(Inherited from Object.)

System_CAPS_pubmethodGetFirstRow(DataGridViewElementStates)

Returns the index of the first DataGridViewRow that meets the specified criteria.

System_CAPS_pubmethodGetFirstRow(DataGridViewElementStates, DataGridViewElementStates)

Returns the index of the first DataGridViewRow that meets the specified inclusion and exclusion criteria.

System_CAPS_pubmethodGetHashCode()

Serves as the default hash function. (Inherited from Object.)

System_CAPS_pubmethodGetLastRow(DataGridViewElementStates)

Returns the index of the last DataGridViewRow that meets the specified criteria.

System_CAPS_pubmethodGetNextRow(Int32, DataGridViewElementStates)

Returns the index of the next DataGridViewRow that meets the specified criteria.

System_CAPS_pubmethodGetNextRow(Int32, DataGridViewElementStates, DataGridViewElementStates)

Returns the index of the next DataGridViewRow that meets the specified inclusion and exclusion criteria.

System_CAPS_pubmethodGetPreviousRow(Int32, DataGridViewElementStates)

Returns the index of the previous DataGridViewRow that meets the specified criteria.

System_CAPS_pubmethodGetPreviousRow(Int32, DataGridViewElementStates, DataGridViewElementStates)

Returns the index of the previous DataGridViewRow that meets the specified inclusion and exclusion criteria.

System_CAPS_pubmethodGetRowCount(DataGridViewElementStates)

Returns the number of DataGridViewRow objects in the collection that meet the specified criteria.

System_CAPS_pubmethodGetRowsHeight(DataGridViewElementStates)

Returns the cumulative height of the DataGridViewRow objects that meet the specified criteria.

System_CAPS_pubmethodGetRowState(Int32)

Gets the state of the row with the specified index.

System_CAPS_pubmethodGetType()

Gets the Type of the current instance.(Inherited from Object.)

System_CAPS_pubmethodIndexOf(DataGridViewRow)

Returns the index of a specified item in the collection.

System_CAPS_pubmethodInsert(Int32, DataGridViewRow)

Inserts the specified DataGridViewRow into the collection.

System_CAPS_pubmethodInsert(Int32, Int32)

Inserts the specified number of rows into the collection at the specified location.

System_CAPS_pubmethodInsert(Int32, Object[])

Inserts a row into the collection at the specified position, and populates the cells with the specified objects.

System_CAPS_pubmethodInsertCopies(Int32, Int32, Int32)

Inserts rows into the collection at the specified position.

System_CAPS_pubmethodInsertCopy(Int32, Int32)

Inserts a row into the collection at the specified position, based on the row at specified position.

System_CAPS_pubmethodInsertRange(Int32, DataGridViewRow[])

Inserts the DataGridViewRow objects into the collection at the specified position.

System_CAPS_protmethodMemberwiseClone()

Creates a shallow copy of the current Object.(Inherited from Object.)

System_CAPS_protmethodOnCollectionChanged(CollectionChangeEventArgs)

Raises the CollectionChanged event.

System_CAPS_pubmethodRemove(DataGridViewRow)

Removes the row from the collection.

System_CAPS_pubmethodRemoveAt(Int32)

Removes the row at the specified position from the collection.

System_CAPS_pubmethodSharedRow(Int32)

Returns the DataGridViewRow at the specified index.

System_CAPS_pubmethodToString()

Returns a string that represents the current object.(Inherited from Object.)

NameDescription
System_CAPS_pubeventCollectionChanged

Occurs when the contents of the collection change.

NameDescription
System_CAPS_pubinterfaceSystem_CAPS_privmethodICollection.CopyTo(Array, Int32)

Copies the elements of the collection to an Array, starting at the specified index.

System_CAPS_pubinterfaceSystem_CAPS_privmethodIEnumerable.GetEnumerator()

Returns an enumerator that iterates through the collection.

System_CAPS_pubinterfaceSystem_CAPS_privmethodIList.Add(Object)

Adds a DataGridViewRow to the collection.

System_CAPS_pubinterfaceSystem_CAPS_privmethodIList.Clear()

Removes all items from the collection.

System_CAPS_pubinterfaceSystem_CAPS_privmethodIList.Contains(Object)

Determines whether the collection contains the specified item.

System_CAPS_pubinterfaceSystem_CAPS_privmethodIList.IndexOf(Object)

Returns the index of a specified item in the collection.

System_CAPS_pubinterfaceSystem_CAPS_privmethodIList.Insert(Int32, Object)

Inserts a DataGridViewRow into the collection at the specified index.

System_CAPS_pubinterfaceSystem_CAPS_privmethodIList.Remove(Object)

Removes the specified DataGridViewRow from the collection.

System_CAPS_pubinterfaceSystem_CAPS_privmethodIList.RemoveAt(Int32)

Removes the DataGridViewRow from the collection at the specified position.

System_CAPS_pubinterfaceSystem_CAPS_privpropertyICollection.Count

Gets the number of elements contained in the collection.

System_CAPS_pubinterfaceSystem_CAPS_privpropertyICollection.IsSynchronized

Gets a value indicating whether access to the collection is synchronized (thread safe).

System_CAPS_pubinterfaceSystem_CAPS_privpropertyICollection.SyncRoot

Gets an object that can be used to synchronize access to the collection.

System_CAPS_pubinterfaceSystem_CAPS_privpropertyIList.IsFixedSize

Gets a value indicating whether the collection has a fixed size.

System_CAPS_pubinterfaceSystem_CAPS_privpropertyIList.IsReadOnly

Gets a value indicating whether the collection is read-only.

System_CAPS_pubinterfaceSystem_CAPS_privpropertyIList.Item[Int32]

Gets or sets the element at the specified index.

NameDescription
System_CAPS_pubmethodAsParallel()

Overloaded. Enables parallelization of a query.(Defined by ParallelEnumerable.)

System_CAPS_pubmethodAsQueryable()

Overloaded. Converts an IEnumerable to an IQueryable.(Defined by Queryable.)

System_CAPS_pubmethodCast<TResult>()

Casts the elements of an IEnumerable to the specified type.(Defined by Enumerable.)

System_CAPS_pubmethodOfType<TResult>()

Filters the elements of an IEnumerable based on a specified type.(Defined by Enumerable.)

The DataGridViewRowCollection contains the DataGridViewRow objects in a DataGridView control. You can retrieve an instance of this class through the control Rows property. The collection maintains a reference to the control through the DataGridView property.

To improve performance, a DataGridViewRowCollection includes shared and unshared rows. Shared rows share memory to reduce the cost of a large record set. If your record set is very large, you should be careful to keep the rows shared as much as possible.

For more information, see Best Practices for Scaling the Windows Forms DataGridView Control.

.NET Framework
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.

Return to top
Show:
© 2016 Microsoft