System.Windows.Forms.DataGridViewCell.FormattedValue Property

Gets the value of the cell as formatted for display.


public object FormattedValue { get; }


Documentation for this section has not yet been entered.


The DataGridViewCell.Value property is the actual data object contained by the cell, whereas the DataGridViewCell.FormattedValue is the formatted representation of this object. The DataGridViewCell.ValueType and DataGridViewCell.FormattedValueType properties correspond to the data types of these values, respectively.

Getting the value of this property calls the DataGridViewCell.GetFormattedValue(object, int, DataGridViewCellStyle@, System.ComponentModel.TypeConverter, System.ComponentModel.TypeConverter, DataGridViewDataErrorContexts) method to convert the cell value into an equivalent display value of the type indicated by the DataGridViewCell.FormattedValueType property. This raises the DataGridView.CellFormatting event, which you can handle to customize the value conversion.

If formatting is unsuccessful, the DataGridView.DataError event occurs. If there is no handler for this event or the handler sets the DataGridViewDataErrorEventArgs.ThrowException property to true, an exception is thrown.


Namespace: System.Windows.Forms
Assembly: System.Windows.Forms (in System.Windows.Forms.dll)
Assembly Versions:
Since: .NET 2.0