To divide a Grid into rows we give it row definitions and the UIElement that needs to be placed in a particular row in that grid we do it like this:
Button Name="Button1" Grid.Row="1"
Now suppose I want to do this thing in code behind dynamically then how can we do it.
Thank You.
If you want to create a Button in code and add to specific cell of the Grid then you can do it like this:
var myButton = new Button();
myButton.Content = "myButton";
Grid.SetColumn(myButton, 1);
Grid.SetRow(myButton, 1);
myGrid.Children.Add(myButton);
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With