.NET Framework Class Library DataGridViewCell..::.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)

Syntax
Public Overridable Function ParseFormattedValue ( _
formattedValue As Object, _
cellStyle As DataGridViewCellStyle, _
formattedValueTypeConverter As TypeConverter, _
valueTypeConverter As TypeConverter _
) As Object
public virtual Object ParseFormattedValue(
Object formattedValue,
DataGridViewCellStyle cellStyle,
TypeConverter formattedValueTypeConverter,
TypeConverter valueTypeConverter
)
public:
virtual Object^ ParseFormattedValue(
Object^ formattedValue,
DataGridViewCellStyle^ cellStyle,
TypeConverter^ formattedValueTypeConverter,
TypeConverter^ valueTypeConverter
)
abstract ParseFormattedValue :
formattedValue:Object *
cellStyle:DataGridViewCellStyle *
formattedValueTypeConverter:TypeConverter *
valueTypeConverter:TypeConverter -> Object
override ParseFormattedValue :
formattedValue:Object *
cellStyle:DataGridViewCellStyle *
formattedValueTypeConverter:TypeConverter *
valueTypeConverter:TypeConverter -> Object

Exceptions
| Exception | Condition |
|---|
| ArgumentNullException |
cellStyle is nullNothingnullptra null reference (Nothing in Visual Basic). | | FormatException | The FormattedValueType property value is nullNothingnullptra null reference (Nothing in Visual Basic). -or- The ValueType property value is nullNothingnullptra null reference (Nothing in Visual Basic). -or-
formattedValue cannot be converted. | | ArgumentException |
formattedValue is nullNothingnullptra null reference (Nothing in Visual Basic). -or- The type of formattedValue does not match the type indicated by the FormattedValueType property. |

Remarks

Version Information
.NET FrameworkSupported in: 4, 3.5, 3.0, 2.0 .NET Framework Client ProfileSupported in: 4, 3.5 SP1

Platforms
Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows XP SP2 x64 Edition, Windows Server 2008 (Server Core Role not supported), Windows Server 2008 R2 (Server Core Role not supported), Windows Server 2003 SP2
The .NET Framework does not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.

See Also
|
Biblioteca de clases de .NET Framework DataGridViewCell..::.ParseFormattedValue (Método) Convierte un valor con formato de presentación en un valor de celda real.
Espacio de nombres:
System.Windows.Forms
Ensamblado:
System.Windows.Forms (en System.Windows.Forms.dll)

Sintaxis
Public Overridable Function ParseFormattedValue ( _
formattedValue As Object, _
cellStyle As DataGridViewCellStyle, _
formattedValueTypeConverter As TypeConverter, _
valueTypeConverter As TypeConverter _
) As Object
public virtual Object ParseFormattedValue(
Object formattedValue,
DataGridViewCellStyle cellStyle,
TypeConverter formattedValueTypeConverter,
TypeConverter valueTypeConverter
)
public:
virtual Object^ ParseFormattedValue(
Object^ formattedValue,
DataGridViewCellStyle^ cellStyle,
TypeConverter^ formattedValueTypeConverter,
TypeConverter^ valueTypeConverter
)
abstract ParseFormattedValue :
formattedValue:Object *
cellStyle:DataGridViewCellStyle *
formattedValueTypeConverter:TypeConverter *
valueTypeConverter:TypeConverter -> Object
override ParseFormattedValue :
formattedValue:Object *
cellStyle:DataGridViewCellStyle *
formattedValueTypeConverter:TypeConverter *
valueTypeConverter:TypeConverter -> Object

Excepciones
| Excepción | Condición |
|---|
| ArgumentNullException |
El valor de cellStyle es nullNothingnullptrreferencia null (Nothing en Visual Basic). | | FormatException | El valor de la propiedad FormattedValueType es nullNothingnullptrreferencia null (Nothing en Visual Basic). O bien El valor de la propiedad ValueType es nullNothingnullptrreferencia null (Nothing en Visual Basic). O bien
No se puede convertir formattedValue. | | ArgumentException |
formattedValue es nullNothingnullptrreferencia null (Nothing en Visual Basic). O bien El tipo de formattedValue no coincide con el tipo indicado por la propiedad FormattedValueType. |

Comentarios
Cuando el usuario edita un valor de celda y confirma el cambio, el control DataGridView llama a este método para convertir el valor presentado de FormattedValueType a ValueType. A continuación, el control establece el valor de la celda subyacente o del origen de datos en el valor convertido. La implementación predeterminada de este método analiza el parámetro formattedValue utilizando las propiedades NullValue, DataSourceNullValue y FormatProvider del estilo de celda que indica el parámetro cellStyle. Si formattedValue es igual a NullValue, este método devuelve el valor de la propiedad DataSourceNullValue o nullNothingnullptrreferencia null (Nothing en Visual Basic) si DataSourceNullValue es DBNull..::.Value y la propiedad ValueType de la celda es un tipo de referencia. Si formattedValue no es igual a NullValue, este método analiza formattedValue mediante la propiedad FormatProvider y los convertidores especificados o predeterminados. Si la celda ValueType acepta valores NULL, este método ajusta el valor devuelto como tipo Nullable<(Of <(T>)>).

Información de versión
.NET FrameworkCompatible con: 4, 3.5, 3.0, 2.0 .NET Framework Client ProfileCompatible con: 4, 3.5 SP1

Plataformas
Windows 7, Windows Vista SP1 o posterior, Windows XP SP3, Windows XP SP2 x64 Edition, Windows Server 2008 (no se admite Server Core), Windows Server 2008 R2 (se admite Server Core con SP1 o posterior), Windows Server 2003 SP2
.NET Framework no admite todas las versiones de todas las plataformas. Para obtener una lista de las versiones compatibles, vea Requisitos de sistema de .NET Framework.

Vea también
|