xamarin forms set the grid row property of an element programmatically

Code Example - xamarin forms set the grid row property of an element programmatically

                
                        tblock.SetValue(Grid.RowProperty, 4);
                    
                
 

add RowDefinition from cs xamarin

                        
                                myGrid.RowDefinitions = new RowDefinitionCollection();
    for (int myCount = 0; myCount < amoutOfRows; myCount++)
    {
          myGrid.RowDefinitions.Add(new RowDefinition { Height = new GridLength(1, GridUnitType.Star) });
    }