DataGridViewCellCollection.Item[] プロパティ

定義

指定した場所にある項目を取得または設定します。 C# では、このプロパティは DataGridViewCellCollection クラスのインデクサーです。

オーバーロード

名前 説明
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

取得または設定するセルの 0 から始まるインデックス。

プロパティ値

指定したインデックスに格納されている 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に属しています。

こちらもご覧ください

適用対象