Once Controls have been added to a WPF Grid, is there a way to programmatically access them by row and/or column index? Something along the lines of:
var myControl = (object)MyGrid.GetChild(int row, int column);
... where GetChild
is the method I wish I had!
There isn't a built-in method for this, but you can easily do it by looking in the Children collection:
myGrid.Children
.Cast<UIElement>()
.First(e => Grid.GetRow(e) == row && Grid.GetColumn(e) == column);