I have a User Control that I need to programmatically add to a Silverlight Grid t a specified Row and Column index. The requirements are such that I will need to insert at arbitrary indices, such that pure databinding is perhaps not ideal.
I would prefer not to have to create the grid from scratch in the code behind. Can this be done? Anyone with example?
Use Grid.Children.Add to add it to the grid, and Grid.SetRow and Grid.SetColumn to set the row and column index. E.g.
Grid.SetRow(myControl, 3);
Grid.SetColumn(myControl, 4);
myGrid.Children.Add(myControl);
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With