You should simply google around to find tons of examples.
You must use the property Height of data grid view.
This changes all rows height one by one:
foreach (DataGridViewRow row in Mydgv.Rows)
{
row.Height =27;
}
To change all in one shot use the trick to change the MinimumHeight property.
Mydgv.RowTemplate.MinimumHeight = 27;
Some more samples
here[
^].