In WPF, I have a Uniform Grid and would like to be able to find the row and column based on the index of a child element.
I know there is a mathematical way of doin
Sorry this is in C# but in principle you need to do
int rows = theGrid.Rows;
int columns = theGrid.Columns;
int index = theGrid.Children.IndexOf(childElement);
int row = index/columns; // divide
int column = index%columns; // modulus
And in VB.NET
dim rows as Integer = theGrid.Rows
dim columns as Integer = theGrid.Columns
dim index as Integer = theGrid.Children.IndexOf(childElement)
dim row as integer = index \ columns
dim column as integer = index mod columns