Click to See Complete Forum and Search --> : Runtime manipulation of grids


olavl
February 6th, 2009, 06:35 AM
I have a grid with a number of rows and columns, that I want to add items to runtime.
Using MyGrid.Children.Add(MyElement); always put the element in row 0, column 0.
Is there a way to specify which row and column you want the element to go from C# code?

Visual Studio 2008
.Net 3.5

olavl
February 6th, 2009, 09:39 AM
After a little more investigation I found out. I need to set the value with:
Grid.SetColumn(MyElement, 1);
Grid.SetRow(MyElement, 2);
This will put MyElement in Column[1], Row[2].