DataGridViewCellCollection 類別

定義

代表 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 IEnumerable
Public Class DataGridViewCellCollection
Inherits BaseCollection
Implements IList
繼承
DataGridViewCellCollection
屬性
實作

備註

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)

方法

Add(DataGridViewCell)

將儲存格加入集合中。

AddRange(DataGridViewCell[])

將儲存格的陣列加入集合中。

Clear()

從集合中清除所有儲存格。

Contains(DataGridViewCell)

判斷指定的儲存格是否包含在集合中。

CopyTo(Array, Int32)

將目前一維 Array 的所有元素複製到指定的一維 Array (從指定的目的 Array 索引開始)。

(繼承來源 BaseCollection)
CopyTo(DataGridViewCell[], Int32)

將整個儲存格的集合複製到陣列中指定位置的陣列內。

CreateObjRef(Type)

建立包含所有相關資訊的物件,這些資訊是產生用來與遠端物件通訊的所需 Proxy。

(繼承來源 MarshalByRefObject)
Equals(Object)

判斷指定的物件是否等於目前的物件。

(繼承來源 Object)
GetEnumerator()

取得允許逐一查看集合之成員的物件。

(繼承來源 BaseCollection)
GetHashCode()

做為預設雜湊函式。

(繼承來源 Object)
GetLifetimeService()
已淘汰.

擷取控制這個執行個體存留期 (Lifetime) 原則的目前存留期服務物件。

(繼承來源 MarshalByRefObject)
GetType()

取得目前執行個體的 Type

(繼承來源 Object)
IndexOf(DataGridViewCell)

傳回指定儲存格的索引。

InitializeLifetimeService()
已淘汰.

取得存留期服務物件,以控制這個執行個體的存留期原則。

(繼承來源 MarshalByRefObject)
Insert(Int32, DataGridViewCell)

將儲存格插入指定索引上的集合中。

MemberwiseClone()

建立目前 Object 的淺層複製。

(繼承來源 Object)
MemberwiseClone(Boolean)

建立目前 MarshalByRefObject 物件的淺層複本。

(繼承來源 MarshalByRefObject)
OnCollectionChanged(CollectionChangeEventArgs)

引發 CollectionChanged 事件。

Remove(DataGridViewCell)

從集合中移除指定的儲存格。

RemoveAt(Int32)

移除在指定索引處的儲存格。

ToString()

傳回代表目前物件的字串。

(繼承來源 Object)

事件

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

適用於

另請參閱