Compartilhar via


DataGrid.UnloadingRow Event

Microsoft Silverlight will reach end of support after October 2021. Learn more.

Occurs when a DataGridRow object becomes available for reuse.

Namespace:  System.Windows.Controls
Assembly:  System.Windows.Controls.Data (in System.Windows.Controls.Data.dll)

Syntax

'Declaration
Public Event UnloadingRow As EventHandler(Of DataGridRowEventArgs)
public event EventHandler<DataGridRowEventArgs> UnloadingRow
<sdk:DataGrid UnloadingRow="eventhandler"/>

Remarks

To improve performance, the DataGrid control does not instantiate a DataGridRow object for each data item in the bound data source. Instead, the data grid creates DataGridRow objects only when they are needed, and reuses them as much as possible. For example, the data grid 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 can be reused. You will typically use this event to undo any changes that were made in a LoadingRow event handler.

Version Information

Silverlight

Supported in: 5, 4, 3

Platforms

For a list of the operating systems and browsers that are supported by Silverlight, see Supported Operating Systems and Browsers.