I have, in a window, a Grid
that contains a RadioButton
, a TextBox
and a Button
, each in column 0, 1, 2, respectively. Th
Put the two grids in a shared size scope, and use SharedSizeGroup
to lock the row heights together:
<SomeContainer Grid.IsSharedSizeScope="True"> <!-- Could be the Window or some more nearby Panel -->
<Grid>
<Grid.RowDefinitions>
<RowDefinition SharedSizeGroup="LabelAndRadioButtonGroup" />
</Grid.RowDefinitions>
<Label Grid.Row="0" />
</Grid>
<Grid>
<Grid.RowDefinitions>
<RowDefinition SharedSizeGroup="LabelAndRadioButtonGroup" />
</Grid.RowDefinitions>
<RadioButton Grid.Row="0" />
</Grid>
</SomeContainer>
See also How to: Share sizing properties between grids in MSDN.
Bind to the ActualHeight
rather than the Height
property:
<RowDefinition Height="{Binding ActualHeight, ElementName=otherTextBox}" />