GRID PANEL:
The Grid element in XAML represents a Grid panel. The following code snippet creates a Grid element and sets its background, width, height, vertical and horizontal alignment properties.
XAML CODE:
<Grid Name="GridPanel" Background="Blue" Width="280" Height="220"
VerticalAlignment="Top" HorizontalAlignment="Center" >
</Grid>
To add rows to a grid by using the XAML editor:
1. In the XAML editor, locate a Grid element.
2 Add a Grid.RowDefinitions element as a child of the Grid element. The code should look like the following:
EXAMPLE Row :
<Grid.RowDefinitions>
<RowDefinition Height="100" />
<RowDefinition Height="Auto" />
<RowDefinition Height="*" />
<RowDefinition Height="5*" />
</Grid.RowDefinitions>
To add columns to a grid by using the XAML editor
1. In the XAML editor, locate a Grid element.
2. Add a Grid.ColumnDefinitions element as a child of the Grid element. The code should look like the following:
EXAMPLE COLUMN:
<Grid.ColumnDefinitions>
<ColumnDefinition Width="100" />
<ColumnDefinition Width="Auto" />
<ColumnDefinition Width="*" />
<ColumnDefinition Width="5*" />
</Grid.ColumnDefinitions>