Thanks DCMonkey, there was something else to add to get it to work.

RowDefinition row = new RowDefinition(); // do this for number of rows
row.Height = new GridLength(20); // to get it to right size
myGrid.RowDefinitions.Add(row);

 

Seems a bit convoluted, but it works.