#468 – FirstColumn Property Allows Blank Cells in a UniformGrid

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 -->


About Sean
Software developer in the Twin Cities area, passionate about software development and sailing.

One Response to #468 – FirstColumn Property Allows Blank Cells in a UniformGrid

  1. tarundotnet says:

    Excellent! Thank you!

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

%d bloggers like this: