用auto就可以了,示例代码如下:
<Grid> <Grid.RowDefinitions> <RowDefinition Height="auto"/> <RowDefinition Height="1*"/> </Grid.RowDefinitions> <Rectangle Height="50" Grid.Row="0" Fill="LightBlue" /> </Grid>
人家问的datagrid,你回复的是grid,不一样啊