I have a UserControl with following code (simplified to make it readable):
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="Auto" />
<RowDefinition Height="Auto" />
<RowDefinition Height="Auto" />
<RowDefinition Height="Auto" />
</Grid.RowDefinitions>
<TextBlock Grid.Row="0" />
<TextBlock Grid.Row="1" />
<DataGrid Grid.Row="2" />
<TextBlock Grid.Row="3" />
</Grid>
Now I want all of the controls to be displayed in a stack, but limited to the size of the window.
The problem is that when I have a lot of data in the DataGrid, it grows beyond the borders and the last TextBlock is not visible - nor the DataGrid scrollbar appears.
When I set third row definition for Star (*), the size of the DataGrid is fine for big amount of items, but in case there are only few items in DataGrid, the last TextBlock appears on the bottom of the screen (not directly after the DataGrid as needed).
When instead of Grid I user StackPanel, it looks the same as in the code above. If I user DockPanel, DataGrid is properly scrollable, but the last TextBlock is not visible at all.
I would imagine the solution to define third row as Height="Auto" and MaxHeight="*", but that's obviously not possible.
Could you help?

