Iterate through grid row, to get each child value in each cell, Xamarin Form

Maxime V 1 Reputation point


I didn't find any way to get all my row cell value in my grid, in my Xamarin form project.

I think the best way is to access to the child element in the row cell, and then get the value, but I am lost.


A Microsoft open-source app platform for building Android and iOS apps with .NET and C#.
5,299 questions
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. John Hardman 261 Reputation points

    I'm not sure quite what you want to do, but given a Grid grid, the following will iterate through all the children of the Grid, getting the row and column of each. That should get you started.

    foreach (View view in grid.Children)
    int row = Grid.GetRow(view);
    int column = Grid.GetColumn(view);

    1 person found this answer helpful.
    0 comments No comments