IDataGridViewEditingCell 接口


为允许操作它的值的单元格定义常用功能。Defines common functionality for a cell that allows the manipulation of its value.

public interface class IDataGridViewEditingCell
public interface IDataGridViewEditingCell
type IDataGridViewEditingCell = interface
Public Interface IDataGridViewEditingCell


此接口由派生自 @no__t 的类(例如 DataGridViewCheckBoxCell)实现,并提供一个用户界面(UI)用于指定值,而无需承载编辑控件。This interface is implemented by classes such as DataGridViewCheckBoxCell that derive from DataGridViewCell and provide a user interface (UI) for specifying values without hosting an editing control. 如果该单元格处于编辑模式,则显示此示例中的 UI。The UI in this case is displayed regardless of whether the cell is in edit mode.

其他单元类型(如 DataGridViewButtonCell)提供 UI,但不存储用户指定的值。Other cell types, such as DataGridViewButtonCell, provide a UI but do not store user-specified values. 在这种情况下,单元类型不实现 @no__t 0 或托管编辑控件。In this case, the cell type does not implement IDataGridViewEditingCell or host an editing control.

当单元格处于编辑模式(如 DataGridViewTextBoxCell)时,显示编辑控件的单元格类型不实现 @no__t,而是提供实现 @no__t 的伴生类。Cell types that display an editing control when the cell is in edit mode, such as DataGridViewTextBoxCell, do not implement IDataGridViewEditingCell but instead provide a companion class that implements IDataGridViewEditingControl. 例如,DataGridViewTextBoxCell 提供从 TextBox 控件派生并实现 @no__t 3 的 @no__t 1。For example, DataGridViewTextBoxCell provides a DataGridViewTextBoxEditingControl that derives from the TextBox control and implements IDataGridViewEditingControl. 在这种情况下,单元 EditType 属性设置为表示编辑控件类型的 @no__t 1 对象。In this case, the cell EditType property is set to a Type object representing the editing control type. 有关实现 IDataGridViewEditingControl 的信息,请参阅 [How:Windows 窗体 DataGridView 单元格中的主机控件 @ no__t-0。For information about implementing IDataGridViewEditingControl, see How to: Host Controls in Windows Forms DataGridView Cells.



获取或设置单元格的格式化值。Gets or sets the formatted value of the cell.


获取或设置指示单元格的值是否已更改的值。Gets or sets a value indicating whether the value of the cell has changed.



检索单元格的格式化值。Retrieves the formatted value of the cell.


准备当前选中的单元格以进行编辑。Prepares the currently selected cell for editing.