Redigera

Dela via


DataGrid.UnloadingRow Event

Definition

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) 

Event Type

Remarks

To improve performance, the EnableRowVirtualization property is set to true by default. 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. Instead, the DataGrid creates DataGridRow objects only when they are needed, and reuses them as much as it can. 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. You typically use this event to undo any changes that were made in a LoadingRow event handler.

Applies to

See also