共用方式為


DataGridViewCell.DataGridViewCellAccessibleObject.Value 屬性

定義

取得或設定一個字串,代表擁有儲存格的格式化值。

public:
 virtual property System::String ^ Value { System::String ^ get(); void set(System::String ^ value); };
public override string Value { get; set; }
public override string? Value { get; set; }
member this.Value : string with get, set
Public Overrides Property Value As String

屬性值

String 儲存格值的表示。

例外狀況

該財產的 Owner 價值為 null

備註

屬性 Value 包含一個字串,代表該單元 FormattedValue 屬性的值。 若 FormattedValuenullValue則包含字串「(null)」。

若擁有的儲存格是標頭儲存格、唯讀或不屬於某一列,設定此屬性則無效。 否則,請設定以下屬性:

  • 結束目前正在進行的編輯並提交該值。

  • 利用儲存格 GetFormattedValueParseFormattedValue 方法將指定值轉換為儲存格 ValueType 屬性所指示的類型。

  • 將儲存格值設為轉換後的值。

適用於

另請參閱