IDataGridViewEditingControl.GetEditingControlFormattedValue(DataGridViewDataErrorContexts) 方法

定义

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

public:
 System::Object ^ GetEditingControlFormattedValue(System::Windows::Forms::DataGridViewDataErrorContexts context);
public object GetEditingControlFormattedValue (System.Windows.Forms.DataGridViewDataErrorContexts context);
abstract member GetEditingControlFormattedValue : System.Windows.Forms.DataGridViewDataErrorContexts -> obj
Public Function GetEditingControlFormattedValue (context As DataGridViewDataErrorContexts) As Object

参数

context
DataGridViewDataErrorContexts

DataGridViewDataErrorContexts 值的按位组合,它指定需要数据的上下文。A bitwise combination of DataGridViewDataErrorContexts values that specifies the context in which the data is needed.

返回

一个 Object,表示单元格内容的格式化版本。An Object that represents the formatted version of the cell contents.

注解

格式化值表示在控件的用户界面中显示的值。The formatted value represents the value as it is displayed in the control's user interface. 格式化值可能不同于绝对值,甚至是控件中包含的实际值的数据类型。The formatted value may be different in absolute value and even data type from the actual value contained in the control.

若要设置控件的格式化值,请使用 EditingControlFormattedValue 属性。To set the formatted value of the control, use the EditingControlFormattedValue property.

实施者说明

在此方法的实现中更改返回值并不会自动更改显示的值。Changing the return value in your implementation of this method does not automatically change the displayed value. 如果值在编辑控件中发生更改,则必须将 true 传递到 NotifyCurrentCellDirty(Boolean) 方法,通知 DataGridView 更改。When the value changes in the editing control, you must notify the DataGridView of the change by passing true to the NotifyCurrentCellDirty(Boolean) method.

适用于

另请参阅