DataGridView.IsCurrentRowDirty 屬性

定義

取得值,指出目前的資料列是否有未認可的變更。

public:
 property bool IsCurrentRowDirty { bool get(); };
[System.ComponentModel.Browsable(false)]
public bool IsCurrentRowDirty { get; }
[<System.ComponentModel.Browsable(false)>]
member this.IsCurrentRowDirty : bool
Public ReadOnly Property IsCurrentRowDirty As Boolean

屬性值

Boolean

如果目前的資料列有未經認可的變更,則為 true;否則為 false

屬性

備註

當鉛筆圖像顯示在資料列時,這個屬性會傳回 true 。 根據預設, IsCurrentRowDirty 除非 DataGridView 系結至支援編輯的 IsCurrentCellDirty 資料來源,否則屬性一律等於 屬性的值,或已實作虛擬模式以使用資料列層級認可範圍。 在這些情況下, DataGridView 將會在資料列層級評估此屬性。

當使用者離開資料列時,控制項會認可所有資料列變更。 使用者也可以按 CTRL+ENTER 來認可資料列變更,而不需離開資料列。 若要以程式設計方式認可資料列變更,請呼叫表單的 Validate 方法。 如果您的資料來源是 BindingSource ,您也可以呼叫 BindingSource.EndEdit

適用於

另請參閱