DataGridViewCellCollection 类    
定义
重要
一些信息与预发行产品相关,相应产品在发行之前可能会进行重大修改。 对于此处提供的信息,Microsoft 不作任何明示或暗示的担保。
表示 DataGridViewRow 中单元格的集合。
public ref class DataGridViewCellCollection : System::Windows::Forms::BaseCollection, System::Collections::IList[System.ComponentModel.ListBindable(false)]
public class DataGridViewCellCollection : System.Windows.Forms.BaseCollection, System.Collections.IList[<System.ComponentModel.ListBindable(false)>]
type DataGridViewCellCollection = class
    inherit BaseCollection
    interface IList
    interface ICollection
    interface IEnumerablePublic Class DataGridViewCellCollection
Inherits BaseCollection
Implements IList- 继承
- 属性
- 实现
注解
DataGridViewCellCollection 对象由 DataGridViewRow.Cells 属性检索。
构造函数
| DataGridViewCellCollection(DataGridViewRow) | 初始化 DataGridViewCellCollection 类的新实例。 | 
属性
| Count | 获取集合中的总元素数。(继承自 BaseCollection) | 
| IsReadOnly | 获取一个值,该值指示集合是否为只读。(继承自 BaseCollection) | 
| IsSynchronized | 获取一个值,该值指示对 ICollection 的访问是否同步。(继承自 BaseCollection) | 
| Item[Int32] | 获取或设置位于提供的索引位置的单元格。 在 C# 中,此属性是 DataGridViewCellCollection 类的索引器。 | 
| Item[String] | 获取或设置具有所提供名称的列中的单元格。 在 C# 中,此属性是 DataGridViewCellCollection 类的索引器。 | 
| List | 获取包含 ArrayList 对象的 DataGridViewCellCollection。 | 
| SyncRoot | 获取可用于同步对 BaseCollection 的访问的对象。(继承自 BaseCollection) | 
方法
事件
| CollectionChanged | 当集合更改时发生。 | 
显式接口实现
| ICollection.CopyTo(Array, Int32) | 从指定索引处开始,将集合中的元素复制到指定的数组。 | 
| ICollection.Count | 获取集合中包含的元素数。 | 
| ICollection.IsSynchronized | 获取一个值,该值指示对集合的访问是否为同步的(线程安全)。 | 
| ICollection.SyncRoot | 获取可用于同步对集合的访问的对象。 | 
| IEnumerable.GetEnumerator() | 返回循环访问集合的枚举数。 | 
| IList.Add(Object) | 向集合中添加一项。 | 
| IList.Clear() | 清除集合。 | 
| IList.Contains(Object) | 确定集合中是否包含指定的值。 | 
| IList.IndexOf(Object) | 确定集合中特定项的索引。 | 
| IList.Insert(Int32, Object) | 将一项插入到集合中的指定位置。 | 
| IList.IsFixedSize | 获取一个值,该值指示集合是否具有固定大小。 | 
| IList.IsReadOnly | 获取一个值,该值指示集合是否具有固定大小。 | 
| IList.Item[Int32] | 获取或设置指定索引处的元素。 | 
| IList.Remove(Object) | 从集合中移除特定对象的第一个匹配项。 | 
| IList.RemoveAt(Int32) | 删除指定索引处的 DataGridViewCell。 | 
扩展方法
| Cast<TResult>(IEnumerable) | 将 IEnumerable 的元素强制转换为指定的类型。 | 
| OfType<TResult>(IEnumerable) | 根据指定类型筛选 IEnumerable 的元素。 | 
| AsParallel(IEnumerable) | 启用查询的并行化。 | 
| AsQueryable(IEnumerable) | 将 IEnumerable 转换为 IQueryable。 |