Image imgControl = new Image();
Grid.SetColumn(imgControl, 1);
gridContainer.Children.Add(imgControl);
The objects contained in the grid are positioned based on the attached Column Row ColumnSpan and RowSpan dependency properties, which are set as shown above.
source
to share