This event is raised when the DataGridView.VirtualMode property is set to true or the DataGridView.DataSource property is set to a value other than null. This event is used to track and store row height information so that it can be restored after a sorting operation. To restore height information, handle the DataGridView.RowHeightInfoNeeded event. Note that this event occurs only when the user changes the height of a row. If you change the height of a row programmatically, you must store the new height information at the same time.
For more information about handling events, see Consuming Events.