DataGrid.CanUserDeleteRows 屬性

定義

取得或設定值,這個值表示使用者是否可以從 DataGrid 中刪除資料列。

public:
 property bool CanUserDeleteRows { bool get(); void set(bool value); };
public bool CanUserDeleteRows { get; set; }
member this.CanUserDeleteRows : bool with get, set
Public Property CanUserDeleteRows As Boolean

屬性值

如果使用者可以刪除資料列,則為true;否則為 false。 已註冊的預設值是 true。 如需哪些因素會影響值的詳細資訊,請參閱 DependencyProperty

備註

根據預設,使用者可以選取一或多個資料列,然後按 Delete 鍵來刪除資料列。 刪除資料列會從 移除資料列所代表 ItemsSource 的專案。 ItemsSource如果 不允許刪除,或者 如果 DataGrid 是唯讀的,即使此屬性設定為 true ,使用者也無法刪除資料列。

適用於