This topic has not yet been rated - Rate this topic

DataGridViewCheckBoxCell.ParseFormattedValue Method

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
)

Parameters

formattedValue
Type: System.Object

The display value of the cell.

cellStyle
Type: System.Windows.Forms.DataGridViewCellStyle

The DataGridViewCellStyle in effect for the cell.

formattedValueTypeConverter
Type: System.ComponentModel.TypeConverter

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

valueTypeConverter
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.
ExceptionCondition
ArgumentNullException

cellStyle is null.

FormatException

The FormattedValueType property value is null.

ArgumentException

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

Supported in: 4.5, 4, 3.5, 3.0, 2.0

.NET Framework Client Profile

Supported in: 4, 3.5 SP1

Windows 8, Windows Server 2012, Windows 7, Windows Vista SP2, Windows Server 2008 (Server Core Role not supported), Windows Server 2008 R2 (Server Core Role supported with SP1 or later; Itanium not supported)

The .NET Framework does not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.

Did you find this helpful?
(1500 characters remaining)
© 2013 Microsoft. All rights reserved.