DataGridViewCellCollection.Add(DataGridViewCell) メソッド
定義
重要
一部の情報は、リリース前に大きく変更される可能性があるプレリリースされた製品に関するものです。 Microsoft は、ここに記載されている情報について、明示または黙示を問わず、一切保証しません。
コレクションにセルを追加します。
public:
virtual int Add(System::Windows::Forms::DataGridViewCell ^ dataGridViewCell);
public virtual int Add(System.Windows.Forms.DataGridViewCell dataGridViewCell);
abstract member Add : System.Windows.Forms.DataGridViewCell -> int
override this.Add : System.Windows.Forms.DataGridViewCell -> int
Public Overridable Function Add (dataGridViewCell As DataGridViewCell) As Integer
パラメーター
- dataGridViewCell
- DataGridViewCell
コレクションに追加する DataGridViewCell 。
返品
新しい要素を挿入する位置。
例外
この DataGridViewCellCollection を所有する行は、既に DataGridView コントロールに属しています。
-又は-
dataGridViewCell は既に DataGridViewRowに属しています。
注釈
DataGridViewRow コントロールに行を追加する前に、DataGridViewにセルを設定するには、このメソッドを使用します。 コントロールに行を追加すると、その行に含まれるセルの数は常にコントロール内の列数と一致するため、このメソッドは役に立たなくなります。