DataGridViewCheckBoxCell.ParseFormattedValue Method

Definition

Converts a value formatted for display to an actual cell value.

public:
 override System::Object ^ ParseFormattedValue(System::Object ^ formattedValue, System::Windows::Forms::DataGridViewCellStyle ^ cellStyle, System::ComponentModel::TypeConverter ^ formattedValueTypeConverter, System::ComponentModel::TypeConverter ^ valueTypeConverter);
public override object ParseFormattedValue (object formattedValue, System.Windows.Forms.DataGridViewCellStyle cellStyle, System.ComponentModel.TypeConverter formattedValueTypeConverter, System.ComponentModel.TypeConverter valueTypeConverter);
public override object? ParseFormattedValue (object? formattedValue, System.Windows.Forms.DataGridViewCellStyle cellStyle, System.ComponentModel.TypeConverter? formattedValueTypeConverter, System.ComponentModel.TypeConverter? valueTypeConverter);
override this.ParseFormattedValue : obj * System.Windows.Forms.DataGridViewCellStyle * System.ComponentModel.TypeConverter * System.ComponentModel.TypeConverter -> obj
Public Overrides Function ParseFormattedValue (formattedValue As Object, cellStyle As DataGridViewCellStyle, formattedValueTypeConverter As TypeConverter, valueTypeConverter As TypeConverter) As Object

Parameters

formattedValue
Object

The display value of the cell.

cellStyle
DataGridViewCellStyle

The DataGridViewCellStyle in effect for the cell.

formattedValueTypeConverter
TypeConverter

A TypeConverter for the display value type, or null to use the default converter.

valueTypeConverter
TypeConverter

A TypeConverter for the cell value type, or null to use the default converter.

Returns

The cell value.

Exceptions

cellStyle is null.

The FormattedValueType property value is null.

formattedValue is null.

-or-

The type of formattedValue does not match the type indicated by the FormattedValueType property.

Remarks

When the user edits a cell value and commits the change, the DataGridView control calls this method to convert the displayed value from the FormattedValueType to the ValueType. The control then sets the underlying cell value or data source value to the converted value.

This method converts the display value of the cell to an actual cell value using the values of the TrueValue, FalseValue, and IndeterminateValue properties if they have been set.

Applies to

See also