#415 – Setting Grid Row Height and Column Width Properties to Absolute Values

You can set the height of a row or the width of a column in a Grid in one of three different ways.

One way to set a row’s height or a column’s width is to use an absolute value.  This mode is known in Blend as “Pixel sized” because you specify the size of the row or column in pixels.  (Actually, in device independent units, which map to pixels on a 96 dpi display).

    <Grid ShowGridLines="True">
    	<Grid.RowDefinitions>
    		<RowDefinition Height="52"/>
    		<RowDefinition/>
    	</Grid.RowDefinitions>

    	<Label Grid.Row="0" Content="Row 0 is 52 units high" />
    	<Label Grid.Row="1" Content="Row 1 takes up the remaining space" />
	</Grid>


A row or column whose size is set using an absolute number will retain its size when the size of the parent Grid changes.

About Sean
Software developer in the Twin Cities area, passionate about .NET technologies. Equally passionate about my own personal projects related to family history and preservation of family stories and photos.

One Response to #415 – Setting Grid Row Height and Column Width Properties to Absolute Values

  1. Pingback: Dew Drop – October 25, 2011 | Alvin Ashcraft's Morning Dew

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

Follow

Get every new post delivered to your Inbox.

Join 131 other followers