DataGridViewSelectedColumnCollection 類別

定義

代表在 DataGridView 中選取的 DataGridViewColumn 物件集合。

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

備註

集合中的數據行順序不保證符合選取的順序。

DataGridViewSelectedColumnCollection使用大量資料列時,不會有效率地執行 。 一般而言, DataGridView 控件不會包含足夠的數據行,因此無法解決問題,但是如果您使用大量數據行,您可以使用 DataGridView.AreAllCellsSelected 來判斷是否已選取整個方格,或者您可以使用 DataGridViewColumnCollection.GetColumnCount 來判斷選取的數據行數目 (或處於指定狀態的數據行數目) 。 如需詳細資訊,請參閱 縮放 Windows Form DataGridView 控制項的最佳做法

屬性

Count

取得集合中的元素總數。

(繼承來源 BaseCollection)
IsReadOnly

取得值,表示集合是否為唯讀。

(繼承來源 BaseCollection)
IsSynchronized

取得值,表示對 ICollection 的存取是否同步化。

(繼承來源 BaseCollection)
Item[Int32]

取得指定之索引上的資料行。

List

取得包含於 BaseCollection 執行個體中的項目清單。

SyncRoot

取得可用以同步存取 BaseCollection 的物件。

(繼承來源 BaseCollection)

方法

Clear()

清除集合。

Contains(DataGridViewColumn)

判斷指定的資料行是否包含在集合中。

CopyTo(Array, Int32)

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

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

將集合的元素複製至以指定的索引為起始點的指定陣列。

CreateObjRef(Type)

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

(繼承來源 MarshalByRefObject)
Equals(Object)

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

(繼承來源 Object)
GetEnumerator()

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

(繼承來源 BaseCollection)
GetHashCode()

做為預設雜湊函式。

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

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

(繼承來源 MarshalByRefObject)
GetType()

取得目前執行個體的 Type

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

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

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

將資料行插入指定位置的集合中。

MemberwiseClone()

建立目前 Object 的淺層複製。

(繼承來源 Object)
MemberwiseClone(Boolean)

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

(繼承來源 MarshalByRefObject)
ToString()

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

(繼承來源 Object)

明確介面實作

ICollection.CopyTo(Array, Int32)

將集合的元素複製至以指定的索引為起始點的指定陣列。

ICollection.Count

取得集合中的項目數。

ICollection.IsSynchronized

取得值,表示是否同步化存取集合 (執行緒安全)。

ICollection.SyncRoot

取得物件,這個物件可以用來對集合進行同步存取。

IEnumerable.GetEnumerator()

傳回逐一查看集合的列舉值。

IList.Add(Object)

實作 Add(Object) 方法。 永遠擲回 NotSupportedException

IList.Clear()

實作 Clear() 方法。 永遠擲回 NotSupportedException

IList.Contains(Object)

判斷指定的值是否包含在集合中。

IList.IndexOf(Object)

傳回指定項目的索引。

IList.Insert(Int32, Object)

實作 Insert(Int32, Object) 方法。 永遠擲回 NotSupportedException

IList.IsFixedSize

取得值,這個值表示集合的大小是否是固定的。

IList.IsReadOnly

取得值,表示集合是否為唯讀。

IList.Item[Int32]

取得位在指定索引處的元素。

IList.Remove(Object)

實作 Remove(Object) 方法。 永遠擲回 NotSupportedException

IList.RemoveAt(Int32)

實作 RemoveAt(Int32) 方法。 永遠擲回 NotSupportedException

擴充方法

Cast<TResult>(IEnumerable)

IEnumerable 的項目轉換成指定的型別。

OfType<TResult>(IEnumerable)

根據指定的型別來篩選 IEnumerable 的項目。

AsParallel(IEnumerable)

啟用查詢的平行化作業。

AsQueryable(IEnumerable)

IEnumerable 轉換成 IQueryable

適用於

另請參閱