DataGridViewCell.DetachEditingControl 方法

定义

DataGridView 中删除单元格的编辑控件。Removes the cell's editing control from the DataGridView.

public:
 virtual void DetachEditingControl();
public virtual void DetachEditingControl ();
abstract member DetachEditingControl : unit -> unit
override this.DetachEditingControl : unit -> unit
Public Overridable Sub DetachEditingControl ()

异常

此单元格没有与 DataGridView 关联。This cell is not associated with a DataGridView.

-or- 关联 EditingControlDataGridView 属性的值为 nullThe EditingControl property of the associated DataGridView has a value of null. 例如,当控件不处于编辑模式时,就会出现这种情况。This is the case, for example, when the control is not in edit mode.

注解

当当前的单元格承载编辑控件并且编辑模式结束时,DataGridView 调用此方法。The DataGridView calls this method when the current cell hosts an editing control and editing mode ends. 此方法从 EditingPanel中删除 EditingControl,然后从 DataGridViewControls 集合中删除 EditingPanelThis method removes the EditingControl from the EditingPanel, and then removes the EditingPanel from the Controls collection of the DataGridView.

适用于

另请参阅