DataGridViewRowCollection 類別
定義
重要
部分資訊涉及發行前產品,在發行之前可能會有大幅修改。 Microsoft 對此處提供的資訊,不做任何明確或隱含的瑕疵擔保。
DataGridViewRow 物件的集合。
public ref class DataGridViewRowCollection : System::Collections::IList
[System.ComponentModel.ListBindable(false)]
public class DataGridViewRowCollection : System.Collections.IList
[<System.ComponentModel.ListBindable(false)>]
type DataGridViewRowCollection = class
interface IList
interface ICollection
interface IEnumerable
[<System.ComponentModel.ListBindable(false)>]
type DataGridViewRowCollection = class
interface ICollection
interface IEnumerable
interface IList
Public Class DataGridViewRowCollection
Implements IList
- 繼承
-
DataGridViewRowCollection
- 屬性
- 實作
備註
DataGridViewRowCollection包含 DataGridViewRow 控制件中的 DataGridView 物件。 您可以透過控件 Rows 屬性擷取這個類別的實例。 集合會透過屬性維護控件的 DataGridView 參考。
若要改善效能,包含 DataGridViewRowCollection 共用和未共享的數據列。 共用數據列會共用記憶體,以減少大型記錄集的成本。 如果您的記錄集非常大,您應該小心盡可能保留共享的數據列。
如需詳細資訊,請參閱 縮放 Windows Form DataGridView 控制項的最佳做法。
建構函式
| DataGridViewRowCollection(DataGridView) |
初始化 DataGridViewRowCollection 類別的新執行個體。 |
屬性
| Count |
取得此集合中的資料列數目。 |
| DataGridView |
取得擁有集合的 DataGridView。 |
| Item[Int32] |
取得指定索引處的 DataGridViewRow。 |
| List |
取得 DataGridViewRow 物件的陣列。 |
方法
事件
| CollectionChanged |
當集合的內容變更時發生。 |
明確介面實作
| ICollection.CopyTo(Array, Int32) |
從指定的索引開始,將集合的項目複製到 Array。 |
| ICollection.Count |
取得集合所包含的項目數目。 |
| ICollection.IsSynchronized |
取得值,表示是否同步化存取集合 (執行緒安全)。 |
| ICollection.SyncRoot |
取得物件,這個物件可以用來對集合進行同步存取。 |
| IEnumerable.GetEnumerator() |
傳回逐一查看集合的列舉值。 |
| IList.Add(Object) |
將 DataGridViewRow 加入集合。 |
| IList.Clear() |
移除集合的所有項目。 |
| IList.Contains(Object) |
指出集合是否含有指定的項目。 |
| IList.IndexOf(Object) |
傳回集合中之指定項目的索引。 |
| IList.Insert(Int32, Object) |
將 DataGridViewRow 插入集合中指定的索引處。 |
| IList.IsFixedSize |
取得值,這個值表示集合的大小是否是固定的。 |
| IList.IsReadOnly |
取得值,表示集合是否為唯讀。 |
| IList.Item[Int32] |
在指定的索引位置上取得或設定項目。 |
| IList.Remove(Object) |
從集合移除指定的 DataGridViewRow。 |
| IList.RemoveAt(Int32) |
從集合中指定的位置移除 DataGridViewRow。 |
擴充方法
| Cast<TResult>(IEnumerable) |
將 IEnumerable 的項目轉換成指定的型別。 |
| OfType<TResult>(IEnumerable) |
根據指定的型別來篩選 IEnumerable 的項目。 |
| AsParallel(IEnumerable) |
啟用查詢的平行化作業。 |
| AsQueryable(IEnumerable) |
將 IEnumerable 轉換成 IQueryable。 |