Add RowDefinitions to a Grid in CS

RowDefinition _rowDefinition = new RowDefinition();
_rowDefinition.Height = new GridLength(65);
LayoutRoot.RowDefinitions.Add(_rowDefinition);


Where LayoutRoot is the Name of a Grid;


To Add a Control to the row, we should maintain a Variable;
e.g:
TextBlock lblNew = new TextBlock();
lblNew.SetValue(Grid.RowProperty, _rowProperty);
lblNew.SetValue(Grid.ColumnProperty, 0);
where _rowProperty is Maintained (With Logic of the Row Details)

Comments