DataGrid.UnloadingRow 事件

定義

DataGridRow 物件可重複使用時發生。

public:
 event EventHandler<System::Windows::Controls::DataGridRowEventArgs ^> ^ UnloadingRow;
public event EventHandler<System.Windows.Controls.DataGridRowEventArgs> UnloadingRow;
member this.UnloadingRow : EventHandler<System.Windows.Controls.DataGridRowEventArgs> 
Public Custom Event UnloadingRow As EventHandler(Of DataGridRowEventArgs) 
Public Event UnloadingRow As EventHandler(Of DataGridRowEventArgs) 

事件類型

備註

為了改善效能, EnableRowVirtualization 屬性預設會設定為 trueEnableRowVirtualization當 屬性設定為 true 時, DataGrid 不會為系結資料來源中的每個資料項目具現化 DataGridRow 物件。 相反地, DataGrid 只有在需要物件時才會建立 DataGridRow 物件,並盡可能重複使用它們。 例如, DataGrid 會針對目前在檢視中的每個資料項目建立 DataGridRow 物件,並在資料列從檢視捲動時回收該資料列。

此事件可讓您在重複使用資料列之前,對資料列進行任何必要的變更。 您通常會使用此事件復原事件處理常式中 LoadingRow 所做的任何變更。

適用於

另請參閱