I constructed this to find out what happens if RowCount is changed. See remarks here.
Private Sub Form1_Shown(sender As Object, e As EventArgs) Handles Me.Shown
'sample data
DataGridView1.ColumnCount = 4
DataGridView1.ColumnHeadersVisible = True
' Set the column header style.
Dim columnHeaderStyle As New DataGridViewCellStyle()
columnHeaderStyle.BackColor = Color.Beige
columnHeaderStyle.Font = New Font("Verdana", 10, FontStyle.Bold)
DataGridView1.ColumnHeadersDefaultCellStyle = columnHeaderStyle
' Set the column header names.
DataGridView1.Columns(0).Name = "Recipe"
DataGridView1.Columns(1).Name = "Category"
DataGridView1.Columns(2).Name = "Main Ingredients"
DataGridView1.Columns(3).Name = "Rating"
' Populate the rows.
Dim row1() As String = {"Meatloaf", "Main Dish", "ground beef", "**"}
Dim row2() As String = {"Key Lime Pie", "Dessert", "lime juice, evaporated milk", "****"}
Dim row3() As String = {"Orange-Salsa Pork Chops", "Main Dish", "pork chops, salsa, orange juice", "****"}
Dim row4() As String = {"Black Bean and Rice Salad", "Salad", "black beans, brown rice", "****"}
Dim row5() As String = {"Chocolate Cheesecake", "Dessert", "cream cheese", "***"}
Dim row6() As String = {"Black Bean Dip", "Appetizer", "black beans, sour cream", "***"}
Dim rows() As Object = {row1, row2, row3, row4, row5, row6}
Dim rowArray As String()
For Each rowArray In rows
DataGridView1.Rows.Add(rowArray)
Next rowArray
End Sub
Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click
Debug.WriteLine(DataGridView1.Rows.Count)
DataGridView1.RowCount = DataGridView1.Rows.Count - 2
Debug.WriteLine(DataGridView1.Rows.Count)
End Sub
Private Sub Button2_Click(sender As Object, e As EventArgs) Handles Button2.Click
Debug.WriteLine(DataGridView1.Rows.Count)
DataGridView1.RowCount = DataGridView1.Rows.Count + 3
Debug.WriteLine(DataGridView1.Rows.Count)
End Sub