DataGridViewCellCollection DataGridViewCellCollection DataGridViewCellCollection DataGridViewCellCollection Class

定義

表示 DataGridViewRow 中儲存格的集合。Represents a collection of cells in a 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
type DataGridViewCellCollection = class
    inherit BaseCollection
    interface IList
    interface ICollection
    interface IEnumerable
Public Class DataGridViewCellCollection
Inherits BaseCollection
Implements IList
繼承
DataGridViewCellCollectionDataGridViewCellCollectionDataGridViewCellCollectionDataGridViewCellCollection
屬性
實作

備註

DataGridViewCellCollection 物件藉由擷取DataGridViewRow.Cells屬性。DataGridViewCellCollection objects are retrieved by the DataGridViewRow.Cells property.

建構函式

DataGridViewCellCollection(DataGridViewRow) DataGridViewCellCollection(DataGridViewRow) DataGridViewCellCollection(DataGridViewRow) DataGridViewCellCollection(DataGridViewRow)

初始化 DataGridViewCellCollection 類別的新執行個體。Initializes a new instance of the DataGridViewCellCollection class.

屬性

Count Count Count Count

取得集合中的項目總數。Gets the total number of elements in the collection.

(Inherited from BaseCollection)
IsReadOnly IsReadOnly IsReadOnly IsReadOnly

取得值,表示集合是否為唯讀。Gets a value indicating whether the collection is read-only.

(Inherited from BaseCollection)
IsSynchronized IsSynchronized IsSynchronized IsSynchronized

取得值,表示對 ICollection 的存取是否同步化。Gets a value indicating whether access to the ICollection is synchronized.

(Inherited from BaseCollection)
Item[Int32] Item[Int32] Item[Int32] Item[Int32]

取得或設定在提供的索引位置上的儲存格。Gets or sets the cell at the provided index location. 在 C# 中,這個屬性是 DataGridViewCellCollection 類別的索引子。In C#, this property is the indexer for the DataGridViewCellCollection class.

Item[String] Item[String] Item[String] Item[String]

取得或設定在資料行中具有指定名稱的儲存格。Gets or sets the cell in the column with the provided name. 在 C# 中,這個屬性是 DataGridViewCellCollection 類別的索引子。In C#, this property is the indexer for the DataGridViewCellCollection class.

List List List List

取得包含 ArrayList 物件的 DataGridViewCellCollectionGets an ArrayList containing DataGridViewCellCollection objects.

SyncRoot SyncRoot SyncRoot SyncRoot

取得可用以同步存取 BaseCollection 的物件。Gets an object that can be used to synchronize access to the BaseCollection.

(Inherited from BaseCollection)

方法

Add(DataGridViewCell) Add(DataGridViewCell) Add(DataGridViewCell) Add(DataGridViewCell)

將儲存格加入集合中。Adds a cell to the collection.

AddRange(DataGridViewCell[]) AddRange(DataGridViewCell[]) AddRange(DataGridViewCell[]) AddRange(DataGridViewCell[])

將儲存格的陣列加入集合中。Adds an array of cells to the collection.

Clear() Clear() Clear() Clear()

從集合中清除所有儲存格。Clears all cells from the collection.

Contains(DataGridViewCell) Contains(DataGridViewCell) Contains(DataGridViewCell) Contains(DataGridViewCell)

判斷指定的儲存格是否包含在集合中。Determines whether the specified cell is contained in the collection.

CopyTo(Array, Int32) CopyTo(Array, Int32) CopyTo(Array, Int32) CopyTo(Array, Int32)

將目前一維 Array 的所有元素複製到指定的一維 Array (從指定的目的 Array 索引開始)。Copies all the elements of the current one-dimensional Array to the specified one-dimensional Array starting at the specified destination Array index.

(Inherited from BaseCollection)
CopyTo(DataGridViewCell[], Int32) CopyTo(DataGridViewCell[], Int32) CopyTo(DataGridViewCell[], Int32) CopyTo(DataGridViewCell[], Int32)

將整個儲存格的集合複製到陣列中指定位置的陣列內。Copies the entire collection of cells into an array at a specified location within the array.

CreateObjRef(Type) CreateObjRef(Type) CreateObjRef(Type) CreateObjRef(Type)

建立包含所有相關資訊的物件,這些資訊是產生用來與遠端物件通訊的所需 Proxy。Creates an object that contains all the relevant information required to generate a proxy used to communicate with a remote object.

(Inherited from MarshalByRefObject)
Equals(Object) Equals(Object) Equals(Object) Equals(Object)

判斷指定的物件是否等於目前的物件。Determines whether the specified object is equal to the current object.

(Inherited from Object)
GetEnumerator() GetEnumerator() GetEnumerator() GetEnumerator()

取得允許逐一查看集合之成員的物件。Gets the object that enables iterating through the members of the collection.

(Inherited from BaseCollection)
GetHashCode() GetHashCode() GetHashCode() GetHashCode()

做為預設雜湊函式。Serves as the default hash function.

(Inherited from Object)
GetLifetimeService() GetLifetimeService() GetLifetimeService() GetLifetimeService()

擷取控制這個執行個體存留期 (Lifetime) 原則的目前存留期服務物件。Retrieves the current lifetime service object that controls the lifetime policy for this instance.

(Inherited from MarshalByRefObject)
GetType() GetType() GetType() GetType()

取得目前執行個體的 TypeGets the Type of the current instance.

(Inherited from Object)
IndexOf(DataGridViewCell) IndexOf(DataGridViewCell) IndexOf(DataGridViewCell) IndexOf(DataGridViewCell)

傳回指定儲存格的索引。Returns the index of the specified cell.

InitializeLifetimeService() InitializeLifetimeService() InitializeLifetimeService() InitializeLifetimeService()

取得存留期服務物件,以控制這個執行個體的存留期原則。Obtains a lifetime service object to control the lifetime policy for this instance.

(Inherited from MarshalByRefObject)
Insert(Int32, DataGridViewCell) Insert(Int32, DataGridViewCell) Insert(Int32, DataGridViewCell) Insert(Int32, DataGridViewCell)

將儲存格插入指定索引上的集合中。Inserts a cell into the collection at the specified index.

MemberwiseClone() MemberwiseClone() MemberwiseClone() MemberwiseClone()

建立目前 Object 的淺層複本 (Shallow Copy)。Creates a shallow copy of the current Object.

(Inherited from Object)
MemberwiseClone(Boolean) MemberwiseClone(Boolean) MemberwiseClone(Boolean) MemberwiseClone(Boolean)

建立目前 MarshalByRefObject 物件的淺層複本。Creates a shallow copy of the current MarshalByRefObject object.

(Inherited from MarshalByRefObject)
OnCollectionChanged(CollectionChangeEventArgs) OnCollectionChanged(CollectionChangeEventArgs) OnCollectionChanged(CollectionChangeEventArgs) OnCollectionChanged(CollectionChangeEventArgs)

引發 CollectionChanged 事件。Raises the CollectionChanged event.

Remove(DataGridViewCell) Remove(DataGridViewCell) Remove(DataGridViewCell) Remove(DataGridViewCell)

從集合中移除指定的儲存格。Removes the specified cell from the collection.

RemoveAt(Int32) RemoveAt(Int32) RemoveAt(Int32) RemoveAt(Int32)

移除在指定索引處的儲存格。Removes the cell at the specified index.

ToString() ToString() ToString() ToString()

傳回代表目前物件的字串。Returns a string that represents the current object.

(Inherited from Object)

事件

CollectionChanged CollectionChanged CollectionChanged CollectionChanged

發生於集合變更時。Occurs when the collection is changed.

明確介面實作

ICollection.CopyTo(Array, Int32) ICollection.CopyTo(Array, Int32) ICollection.CopyTo(Array, Int32) ICollection.CopyTo(Array, Int32)

將集合的元素複製至以指定的索引為起始點的指定陣列。Copies the elements of the collection to the specified array, starting at the specified index.

ICollection.Count ICollection.Count ICollection.Count ICollection.Count

取得集合所包含的項目數目。Gets the number of elements contained in the collection.

ICollection.IsSynchronized ICollection.IsSynchronized ICollection.IsSynchronized ICollection.IsSynchronized

取得值,表示是否同步化存取集合 (執行緒安全)。Gets a value indicating whether access to the collection is synchronized (thread safe).

ICollection.SyncRoot ICollection.SyncRoot ICollection.SyncRoot ICollection.SyncRoot

取得物件,這個物件可以用來對集合進行同步存取。Gets an object that can be used to synchronize access to the collection.

IEnumerable.GetEnumerator() IEnumerable.GetEnumerator() IEnumerable.GetEnumerator() IEnumerable.GetEnumerator()

傳回逐一查看集合的列舉值。Returns an enumerator that iterates through a collection.

IList.Add(Object) IList.Add(Object) IList.Add(Object) IList.Add(Object)

將項目加入至集合。Adds an item to the collection.

IList.Clear() IList.Clear() IList.Clear() IList.Clear()

清除集合。Clears the collection.

IList.Contains(Object) IList.Contains(Object) IList.Contains(Object) IList.Contains(Object)

判斷集合是否包含指定的值。Determines whether the collection contains the specified value.

IList.IndexOf(Object) IList.IndexOf(Object) IList.IndexOf(Object) IList.IndexOf(Object)

判斷集合中特定項目的索引。Determines the index of a specific item in a collection.

IList.Insert(Int32, Object) IList.Insert(Int32, Object) IList.Insert(Int32, Object) IList.Insert(Int32, Object)

將項目插入指定位置上的集合中。Inserts an item into the collection at the specified position.

IList.IsFixedSize IList.IsFixedSize IList.IsFixedSize IList.IsFixedSize

取得值,這個值表示集合的大小是否是固定的。Gets a value indicating whether the collection has a fixed size.

IList.IsReadOnly IList.IsReadOnly IList.IsReadOnly IList.IsReadOnly

取得值,這個值表示集合的大小是否是固定的。Gets a value indicating whether the collection has a fixed size.

IList.Item[Int32] IList.Item[Int32] IList.Item[Int32] IList.Item[Int32]

在指定的索引位置上取得或設定項目。Gets or sets the element at the specified index.

IList.Remove(Object) IList.Remove(Object) IList.Remove(Object) IList.Remove(Object)

從集合中移除第一個出現的特定物件。Removes the first occurrence of a specific object from the collection.

IList.RemoveAt(Int32) IList.RemoveAt(Int32) IList.RemoveAt(Int32) IList.RemoveAt(Int32)

移除在指定索引處的 DataGridViewCellRemoves the DataGridViewCell at the specified index.

Extension Methods

Cast<TResult>(IEnumerable) Cast<TResult>(IEnumerable) Cast<TResult>(IEnumerable) Cast<TResult>(IEnumerable)

IEnumerable 的項目轉換成指定的型別。Casts the elements of an IEnumerable to the specified type.

OfType<TResult>(IEnumerable) OfType<TResult>(IEnumerable) OfType<TResult>(IEnumerable) OfType<TResult>(IEnumerable)

根據指定的型別來篩選 IEnumerable 的項目。Filters the elements of an IEnumerable based on a specified type.

AsParallel(IEnumerable) AsParallel(IEnumerable) AsParallel(IEnumerable) AsParallel(IEnumerable)

啟用查詢的平行化作業。Enables parallelization of a query.

AsQueryable(IEnumerable) AsQueryable(IEnumerable) AsQueryable(IEnumerable) AsQueryable(IEnumerable)

將轉換IEnumerableIQueryableConverts an IEnumerable to an IQueryable.

適用於

另請參閱