#416 – Setting Grid Rows and Columns to Autosize
October 26, 2011 1 Comment
When specifying the height of a row or the width of a column in a Grid, you can indicate that you want the row or column to automatically size to fit its content. You can specify auto-sizing using the keyword “Auto” for the row height or column width.
<Grid ShowGridLines="True"> <Grid.RowDefinitions> <RowDefinition Height="Auto"/> <RowDefinition/> </Grid.RowDefinitions> <Label Grid.Row="0" Content="Row 0 autosizes to this label" /> <Label Grid.Row="1" Content="Row 1 takes up the remaining space" /> </Grid>
Pingback: Dew Drop – October 26, 2011 | Alvin Ashcraft's Morning Dew