DataGridViewCell::DataGridViewCellAccessibleObject::Value Property
Gets or sets a string representing the formatted value of the owning cell.
Assembly: System.Windows.Forms (in System.Windows.Forms.dll)
public: property String^ Value { [SecurityPermissionAttribute(SecurityAction::Demand, Flags = SecurityPermissionFlag::UnmanagedCode)] virtual String^ get() override; [SecurityPermissionAttribute(SecurityAction::Demand, Flags = SecurityPermissionFlag::UnmanagedCode)] virtual void set(String^ value) override; }
| Exception | Condition |
|---|---|
| InvalidOperationException | The value of the Owner property is null. |
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.
to call unmanaged code. Demand value: Demand. Permission value: UnmanagedCode
Available since 2.0