This event is useful for preserving custom row heights after a sorting operation. This is necessary because sorting operations are normally handled by the data source, which does not keep track of the correspondence between rows of data and rows in the control. This event occurs only when the DataGridView.DataSource property has been set or when the DataGridView.VirtualMode property is true. In the latter case, you provide your own data store and sorting operations. Handle the DataGridView.RowHeightInfoPushed event to store updated height information when the user changes a row height. Use DataGridView.RowHeightInfoNeeded to retrieve the stored height information when the control needs it.
For more information about handling events, see Consuming Events.