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 A,加入收藏。
傳回
插入新元素的位置。
例外狀況
擁有這筆的 DataGridViewCellCollection 那一列已經屬於控制 DataGridView 組。
-或-
dataGridViewCell 已經屬於 DataGridViewRow。
備註
用這個方法在將 a DataGridViewRow 的欄位填入儲存格,再把該列加入 DataGridView 控制項。 一旦你將該列加入控制項,所包含的儲存格數總是與控制項中的欄位數相符,因此此方法不再有用。