wpf add rowd grid programmatically code example
Example: add row and columns to grid wpf in code
TheGrid.RowDefinitions.Add(new RowDefinition());
var uc = new MyUserControl();
TheGrid.Children.Add(uc);
Grid.SetRow(uc, TheGrid.RowDefinitions.Count - 1);