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!
System::Windows::Controls::Grid^ myGrid = nullptr; System::Windows::Controls::UserControl^ pUserControl = nullptr;
you could just give your grid column/row a name
and access it programmatically by calling it and using "."
The Children property of the grid object will give you a collection of all the children of the Grid (from the Panel class).
As far as getting the coordinates in the grid, look at the static methods in the Grid class (GetRow() & GetColumn()).
Hope that sets you off in the right direction.
This answer will help you
There isn't a built-in method for this, but you can easily do it by looking in the Children collection: