Hi,
As the subject says I want to insert an image into the 2nd column of grid defined with 2 columndefintions.
Programmatically that is???
I cannot see how to select the column using grid.Children.insert(1, img) does not work.
Malcolm
Hi,
As the subject says I want to insert an image into the 2nd column of grid defined with 2 columndefintions.
Programmatically that is???
I cannot see how to select the column using grid.Children.insert(1, img) does not work.
Malcolm
The row/column index on an element in WPF is an attached property. You set it using a static method on Grid, like this:
Grid.SetColumn(img, 1);
Image imgControl = new Image();
Grid.SetColumn(imgControl, 1);
gridContainer.Children.Add(imgControl);
Objects contained in a grid are positioned based on the attached dependency properties Column Row ColumnSpan and RowSpan which are set as shown above.