DataGridViewRowCollection 类    
定义
重要
一些信息与预发行产品相关,相应产品在发行之前可能会进行重大修改。 对于此处提供的信息,Microsoft 不作任何明示或暗示的担保。
DataGridViewRow 对象的集合。
public ref class DataGridViewRowCollection : System::Collections::IList[System.ComponentModel.ListBindable(false)]
public class DataGridViewRowCollection : System.Collections.IList[<System.ComponentModel.ListBindable(false)>]
type DataGridViewRowCollection = class
    interface IList
    interface ICollection
    interface IEnumerable[<System.ComponentModel.ListBindable(false)>]
type DataGridViewRowCollection = class
    interface ICollection
    interface IEnumerable
    interface IListPublic Class DataGridViewRowCollection
Implements IList- 继承
- 
				DataGridViewRowCollection
- 属性
- 实现
注解
包含 DataGridViewRowCollectionDataGridViewRow 控件中的 DataGridView 对象。 可以通过 控件 Rows 属性检索此类的实例。 集合通过 属性维护对 控件的 DataGridView 引用。
为了提高性能, DataGridViewRowCollection 包括共享行和非共享行。 共享行共享内存以降低大型记录集的成本。 如果记录集非常大,应注意尽可能多地共享行。
有关详细信息,请参阅 缩放 Windows 窗体 DataGridView 控件的最佳做法。
构造函数
| DataGridViewRowCollection(DataGridView) | 初始化 DataGridViewRowCollection 类的新实例。 | 
属性
| Count | 获取集合中的行数。 | 
| DataGridView | 获取拥有集合的 DataGridView。 | 
| Item[Int32] | 获取位于指定索引处的 DataGridViewRow。 | 
| List | 获取 DataGridViewRow 对象数组。 | 
方法
事件
| CollectionChanged | 在该集合的内容发生更改时发生。 | 
显式接口实现
| ICollection.CopyTo(Array, Int32) | 从指定索引位置开始将集合中的元素复制到 Array。 | 
| ICollection.Count | 获取集合中包含的元素数。 | 
| ICollection.IsSynchronized | 获取一个值,该值指示对集合的访问是否为同步的(线程安全)。 | 
| ICollection.SyncRoot | 获取可用于同步对集合的访问的对象。 | 
| IEnumerable.GetEnumerator() | 返回一个循环访问集合的枚举器。 | 
| IList.Add(Object) | 将 DataGridViewRow 添加到集合。 | 
| IList.Clear() | 从集合中移除所有项。 | 
| IList.Contains(Object) | 确定集合中是否包含指定的项。 | 
| IList.IndexOf(Object) | 返回集合中的指定项的索引。 | 
| IList.Insert(Int32, Object) | 将 DataGridViewRow 插入到集合中的指定索引处。 | 
| IList.IsFixedSize | 获取一个值,该值指示集合是否具有固定大小。 | 
| IList.IsReadOnly | 获取一个值,该值指示集合是否为只读。 | 
| IList.Item[Int32] | 获取或设置指定索引处的元素。 | 
| IList.Remove(Object) | 从集合中移除指定的 DataGridViewRow。 | 
| IList.RemoveAt(Int32) | 从集合中删除位于指定位置的 DataGridViewRow。 | 
扩展方法
| Cast<TResult>(IEnumerable) | 将 IEnumerable 的元素强制转换为指定的类型。 | 
| OfType<TResult>(IEnumerable) | 根据指定类型筛选 IEnumerable 的元素。 | 
| AsParallel(IEnumerable) | 启用查询的并行化。 | 
| AsQueryable(IEnumerable) | 将 IEnumerable 转换为 IQueryable。 |