DataGrid.UnloadingRow 事件

定義

DataGridRow 物件可重複使用時發生。Occurs when a DataGridRow object becomes available for reuse.

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) 

事件類型

EventHandler<DataGridRowEventArgs>

備註

為了改善效能, EnableRowVirtualization 預設會將屬性設定為 trueTo improve performance, the EnableRowVirtualization property is set to true by default. EnableRowVirtualization 屬性設定為時 true ,不會針對系結 DataGrid DataGridRow 資料來源中的每個資料項目具現化物件。When the EnableRowVirtualization property is set to true, the DataGrid does not instantiate a DataGridRow object for each data item in the bound data source. 相反地, DataGrid DataGridRow 只有在需要時才會建立物件,並且盡可能重複使用它們。Instead, the DataGrid creates DataGridRow objects only when they are needed, and reuses them as much as it can. 例如, DataGrid DataGridRow 會為目前為 view 的每個資料項目建立一個物件,並在資料列向外滾動時回收該資料列。For example, the DataGrid creates a DataGridRow object for each data item that is currently in view and recycles the row when it scrolls out of view.

此事件可讓您在重複使用資料列之前,對該資料列進行任何必要的變更。This event enables you to make any necessary changes to a row before it is reused. 您通常會使用此事件來復原在事件處理常式中所做的任何變更 LoadingRowYou typically use this event to undo any changes that were made in a LoadingRow event handler.

適用於

另請參閱