通过


DataGridView.DataGridViewControlCollection 类

定义

表示包含在一个 DataGridView. 上的控件的集合。

public: ref class DataGridView::DataGridViewControlCollection : System::Windows::Forms::Control::ControlCollection
[System.Runtime.InteropServices.ComVisible(false)]
public class DataGridView.DataGridViewControlCollection : System.Windows.Forms.Control.ControlCollection
public class DataGridView.DataGridViewControlCollection : System.Windows.Forms.Control.ControlCollection
[<System.Runtime.InteropServices.ComVisible(false)>]
type DataGridView.DataGridViewControlCollection = class
    inherit Control.ControlCollection
type DataGridView.DataGridViewControlCollection = class
    inherit Control.ControlCollection
Public Class DataGridView.DataGridViewControlCollection
Inherits Control.ControlCollection
继承
DataGridView.DataGridViewControlCollection
属性

注解

控件 Controls 的属性 DataGridView 返回一个类型 Control.ControlCollection 实例,你可以将其强制转换为类型的 DataGridView.DataGridViewControlCollection实例。

包括 DataGridView.DataGridViewControlCollection 编辑控件和滚动条等 DataGridView控件。

构造函数

名称 说明
DataGridView.DataGridViewControlCollection(DataGridView)

初始化 DataGridView.DataGridViewControlCollection 类的新实例。

属性

名称 说明
Item[Int32]

指示 Control 集合中指定索引位置处。

(继承自 Control.ControlCollection)
Item[String]

指示集合中具有指定键的键 Control

(继承自 Control.ControlCollection)
Owner

获取拥有此 Control.ControlCollection权限的控件。

(继承自 Control.ControlCollection)

方法

名称 说明
Add(Control)

将指定的控件添加到控件集合。

(继承自 Control.ControlCollection)
AddRange(Control[])

将控件对象的数组添加到集合中。

(继承自 Control.ControlCollection)
Clear()

DataGridView中删除所有控件。

Contains(Control)

确定指定的控件是否是集合的成员。

(继承自 Control.ControlCollection)
ContainsKey(String)

确定 Control.ControlCollection 包含具有指定键的项。

(继承自 Control.ControlCollection)
CopyTo(Control[], Int32)

从目标数组的指定索引处开始,将数组DataGridView.DataGridViewControlCollectionControl的内容复制到数组中。

Find(String, Boolean)

按控件 Name 的属性搜索控件,并生成匹配的所有控件的数组。

(继承自 Control.ControlCollection)
GetChildIndex(Control, Boolean)

检索控件集合中指定子控件的索引,如果指定的控件不在控件集合中,可以选择引发异常。

(继承自 Control.ControlCollection)
GetChildIndex(Control)

检索控件集合中指定子控件的索引。

(继承自 Control.ControlCollection)
GetEnumerator()

检索对用于循环访问枚举 Control.ControlCollection器对象的引用。

(继承自 Control.ControlCollection)
GetType()

获取当前实例的 Type

(继承自 Object)
IndexOf(Control)

检索控件集合中指定控件的索引。

(继承自 Control.ControlCollection)
IndexOfKey(String)

检索集合中指定项的第一个匹配项的索引。

(继承自 Control.ControlCollection)
Insert(Int32, Control)

将指定的 Control 指定插入 DataGridView.DataGridViewControlCollection 到指定索引处。

MemberwiseClone()

创建当前 Object的浅表副本。

(继承自 Object)
Remove(Control)

DataGridView.DataGridViewControlCollection.. 中删除指定的控件。

RemoveAt(Int32)

从指定索引位置的控件集合中删除控件。

(继承自 Control.ControlCollection)
RemoveByKey(String)

删除具有指定键的子控件。

(继承自 Control.ControlCollection)
SetChildIndex(Control, Int32)

将集合中指定子控件的索引设置为指定的索引值。

(继承自 Control.ControlCollection)
ToString()

返回一个表示当前对象的字符串。

(继承自 Object)

显式接口实现

名称 说明
ICloneable.Clone()

此 API 支持产品基础结构,不能在代码中直接使用。

有关此成员的说明,请参阅 Clone()

(继承自 Control.ControlCollection)
ICollection.IsSynchronized

有关此成员的说明,请参阅 IsSynchronized 该属性。

(继承自 ArrangedElementCollection)
ICollection.SyncRoot

有关此成员的说明,请参阅 SyncRoot 该属性。

(继承自 ArrangedElementCollection)
IList.Add(Object)

此 API 支持产品基础结构,不能在代码中直接使用。

有关此成员的说明,请参阅 Add(Object)

(继承自 Control.ControlCollection)
IList.Clear()

有关此成员的说明,请参阅 Clear() 方法。

(继承自 ArrangedElementCollection)
IList.IsFixedSize

有关此成员的说明,请参阅 IsFixedSize 该属性。

(继承自 ArrangedElementCollection)
IList.Item[Int32]

有关此成员的说明,请参阅 Item[Int32] 该属性。

(继承自 ArrangedElementCollection)
IList.Remove(Object)

此 API 支持产品基础结构,不能在代码中直接使用。

有关此成员的说明,请参阅 Remove(Object)

(继承自 Control.ControlCollection)
IList.RemoveAt(Int32)

有关此成员的说明,请参阅 RemoveAt(Int32) 方法。

(继承自 ArrangedElementCollection)

扩展方法

名称 说明
AsParallel(IEnumerable)

启用查询的并行化。

AsQueryable(IEnumerable)

IEnumerable 转换为 IQueryable

Cast<TResult>(IEnumerable)

IEnumerable 的元素强制转换为指定类型。

OfType<TResult>(IEnumerable)

根据指定类型筛选 IEnumerable 的元素。

适用于

另请参阅