DataGridViewCell.DataGridViewCellAccessibleObject.Value Property

Definition

Gets or sets a string representing the formatted value of the owning cell.

C#
public override string Value { get; set; }
C#
public override string? Value { get; set; }

Property Value

A String representation of the cell value.

Exceptions

The value of the Owner property is null.

Remarks

The Value property contains a string that represents the value of the cell FormattedValue property. If FormattedValue is null, Value contains the string "(null)".

Setting this property has no effect if the owning cell is a header cell, is read-only, or does not belong to a row. Otherwise, setting this property:

  • Ends any edit currently in progress and commits the value.

  • Uses the cell GetFormattedValue and ParseFormattedValue methods to convert the specified value to the type indicated by the cell ValueType property.

  • Sets the cell value to the converted value.

Applies to

Produkt Verzie
.NET Framework 2.0, 3.0, 3.5, 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1
Windows Desktop 3.0, 3.1, 5, 6, 7, 8, 9, 10

See also