1: 2: 3: 4: 5:
Dim NumberOfRowsToShow As Integer = 10 Dim TotalHeight As Integer = (NumberOfRowsToShow * DataGridView1.RowTemplate.Height) + DataGridView1.ColumnHeadersHeight DataGridView1.Height = TotalHeight