#468 – FirstColumn Property Allows Blank Cells in a UniformGrid
January 9, 2012 1 Comment
A UniformGrid will contain child elements in the order in which they appear in the XAML file where the UniformGrid is defined. They will be placed into the first row of the UniformGrid (left to right) until the row fills up and then being filling the second row.
Child elements will normally appear starting in the first column of the first row. You can instead have the first child appear in a different column by specifying a value for the FirstColumn property. This property indicates the 0-based column number where the first child element will appear. Child elements will then continue to fill in consecutive columns on the first row and then continue on the second row when the first fills up.
<UniformGrid Rows="5" Columns="7" FirstColumn="3" > <Border BorderBrush="Black" BorderThickness="1"><Label Content="1"/></Border> <Border BorderBrush="Black" BorderThickness="1"><Label Content="2"/></Border> <Border BorderBrush="Black" BorderThickness="1"><Label Content="3"/></Border> <!-- etc --> </UniformGrid>