This documentation is archived and is not being maintained.

DataGridViewRowCollection Class

A collection of DataGridViewRow objects.

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

public class DataGridViewRowCollection : IList, 
	ICollection, IEnumerable

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.


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

Windows 7, Windows Vista, Windows XP SP2, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP Starter Edition, Windows Server 2008 R2, Windows Server 2008, Windows Server 2003, Windows Server 2000 SP4, Windows Millennium Edition, Windows 98

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

.NET Framework

Supported in: 3.5, 3.0, 2.0