DataGridViewSelectedCellCollection DataGridViewSelectedCellCollection DataGridViewSelectedCellCollection DataGridViewSelectedCellCollection Class

定義

代表在 DataGridView 中選取的儲存格集合。Represents a collection of cells that are selected in a DataGridView.

public ref class DataGridViewSelectedCellCollection : System::Windows::Forms::BaseCollection, System::Collections::IList
[System.ComponentModel.ListBindable(false)]
public class DataGridViewSelectedCellCollection : System.Windows.Forms.BaseCollection, System.Collections.IList
type DataGridViewSelectedCellCollection = class
    inherit BaseCollection
    interface IList
    interface ICollection
    interface IEnumerable
Public Class DataGridViewSelectedCellCollection
Inherits BaseCollection
Implements IList
繼承
DataGridViewSelectedCellCollectionDataGridViewSelectedCellCollectionDataGridViewSelectedCellCollectionDataGridViewSelectedCellCollection
屬性
實作

備註

不保證集合中資料格的順序符合選取的順序。The order of cells in the collection is not guaranteed to match the order in which they were selected.

屬性

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 the cell at the specified index.

List List List List

取得集合中的元素清單。Gets a list of elements in the collection.

SyncRoot SyncRoot SyncRoot SyncRoot

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

(Inherited from BaseCollection)

方法

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

清除集合。Clears 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)

將集合的元素複製到指定的 DataGridViewCell 陣列 (從指定的索引開始)。Copies the elements of the collection to the specified DataGridViewCell array, starting at the specified index.

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)
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.

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)
ToString() ToString() ToString() ToString()

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

(Inherited from Object)

明確介面實作

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 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 can be used to iterate through the collection.

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

實作 Add(Object) 方法。Implements the Add(Object) method. 永遠擲回 NotSupportedExceptionAlways throws NotSupportedException.

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

實作 Clear() 方法。Implements the Clear() method. 永遠擲回 NotSupportedExceptionAlways throws NotSupportedException.

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

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

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

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

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

實作 Insert(Int32, Object) 方法。Implements the Insert(Int32, Object) method. 永遠擲回 NotSupportedExceptionAlways throws NotSupportedException.

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 is read-only.

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

取得位在指定索引處的元素。Gets the element at the specified index.

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

實作 Remove(Object) 方法。Implements the Remove(Object) method. 永遠擲回 NotSupportedExceptionAlways throws NotSupportedException.

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

實作 RemoveAt(Int32) 方法。Implements the RemoveAt(Int32) method. 永遠擲回 NotSupportedExceptionAlways throws NotSupportedException.

擴充方法

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)

IEnumerable 轉換成 IQueryableConverts an IEnumerable to an IQueryable.

適用於

另請參閱