語言

DataGridViewCellCollection.Item[] 屬性

定義

在指定地點取得或設置物品。 在 C# 中,這個屬性就是類別的 DataGridViewCellCollection 索引器。

多載

名稱 Description
Item[Int32]

取得或設定格子到所提供的索引位置。 在 C# 中,這個屬性就是類別的 DataGridViewCellCollection 索引器。

Item[String]

取得或設定欄位中以所提供名稱的儲存格。 在 C# 中,這個屬性就是類別的 DataGridViewCellCollection 索引器。

Item[Int32]

來源:
DataGridViewCellCollection.cs
來源:
DataGridViewCellCollection.cs
來源:
DataGridViewCellCollection.cs
來源:
DataGridViewCellCollection.cs
來源:
DataGridViewCellCollection.cs

取得或設定格子到所提供的索引位置。 在 C# 中,這個屬性就是類別的 DataGridViewCellCollection 索引器。

public:
 property System::Windows::Forms::DataGridViewCell ^ default[int] { System::Windows::Forms::DataGridViewCell ^ get(int index); void set(int index, System::Windows::Forms::DataGridViewCell ^ value); };
public System.Windows.Forms.DataGridViewCell this[int index] { get; set; }
member this.Item(int) : System.Windows.Forms.DataGridViewCell with get, set
Default Public Property Item(index As Integer) As DataGridViewCell

參數

index
Int32

要取得或設定的格子的零基指數。

屬性值

它們 DataGridViewCell 會儲存在給定的索引上。

例外狀況

設定此屬性時指定的值為 null。

設定此屬性時指定的儲存格已屬於控制 DataGridView 項。

-或-

設定此屬性時指定的儲存格已屬於 DataGridViewRow。

index 小於0。

-或-

index 等於或大於集合中儲存格的數量。

另請參閱

適用於

Item[String]

來源:
DataGridViewCellCollection.cs
來源:
DataGridViewCellCollection.cs
來源:
DataGridViewCellCollection.cs
來源:
DataGridViewCellCollection.cs
來源:
DataGridViewCellCollection.cs

取得或設定欄位中以所提供名稱的儲存格。 在 C# 中,這個屬性就是類別的 DataGridViewCellCollection 索引器。

public:
 property System::Windows::Forms::DataGridViewCell ^ default[System::String ^] { System::Windows::Forms::DataGridViewCell ^ get(System::String ^ columnName); void set(System::String ^ columnName, System::Windows::Forms::DataGridViewCell ^ value); };
public System.Windows.Forms.DataGridViewCell this[string columnName] { get; set; }
member this.Item(string) : System.Windows.Forms.DataGridViewCell with get, set
Default Public Property Item(columnName As String) As DataGridViewCell

參數

columnName
String

欄位名稱,用來取得或設定儲存格。

屬性值

它們 DataGridViewCell 會儲存在與名字相關的欄位中。

例外狀況

columnName 與控制中任何欄位名稱不符。

設定此屬性時指定的值為 null。

設定此屬性時指定的儲存格已屬於控制 DataGridView 項。

-或-

設定此屬性時指定的儲存格已屬於 DataGridViewRow。

另請參閱

適用於