DataGridViewCellCollection.Remove(DataGridViewCell) 方法

定義

從集合中移除指定的儲存格。

public:
 virtual void Remove(System::Windows::Forms::DataGridViewCell ^ cell);
public virtual void Remove (System.Windows.Forms.DataGridViewCell cell);
abstract member Remove : System.Windows.Forms.DataGridViewCell -> unit
override this.Remove : System.Windows.Forms.DataGridViewCell -> unit
Public Overridable Sub Remove (cell As DataGridViewCell)

參數

cell
DataGridViewCell

要從集合中移除的 DataGridViewCell

例外狀況

擁有這個 DataGridViewCellCollection 的資料列已經屬於 DataGridView 控制項。

在集合中找不到 cell

備註

在將包含的資料列新增至 DataGridView 控制項之前,請使用此方法來改變集合。 將資料列加入控制項之後,它所包含的儲存格數目一律會符合控制項中的資料行數目,因此此方法不再有用。

適用於

另請參閱