Set grid column or grid row in C# code behind Set grid column or grid row in C# code behind windows windows

Set grid column or grid row in C# code behind


You can make use of the SetRow, SetColumn, SetColumnSpan Methods:

Grid.Children.Add(stackPanel);Grid.SetRow(stackPanel, 1);Grid.SetColumn(stackPanel, 0);Grid.SetColumnSpan(stackPanel, 2);