DataGridViewCheckBoxCell.ParseFormattedValue Method (Object, DataGridViewCellStyle, TypeConverter, TypeConverter)


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

Namespace:   System.Windows.Forms
Assembly:  System.Windows.Forms (in System.Windows.Forms.dll)

public override object ParseFormattedValue(
	object formattedValue,
	DataGridViewCellStyle cellStyle,
	TypeConverter formattedValueTypeConverter,
	TypeConverter valueTypeConverter


Type: System.Object

The display value of the cell.

Type: System.Windows.Forms.DataGridViewCellStyle

The DataGridViewCellStyle in effect for the cell.

Type: System.ComponentModel.TypeConverter

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

Type: System.ComponentModel.TypeConverter

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

Return Value

Type: System.Object

The cell value.

Exception Condition

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.

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.

.NET Framework
Available since 2.0
Return to top