All,
I am coming from a primarily ASP.NET background, but have experience with Windows forms as well. I am trying to learn how to layout my WPF app. I have the following code:
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="40" />
<RowDefinition Height="*" />
<RowDefinition Height="40" />
</Grid.RowDefinitions>
<Button Grid.Row="0" Width="80" Content="Do Something"
HorizontalAlignment="Right" Margin="5" />
<DataGrid Grid.Row="1" Name="dgGrid" AutoGenerateColumns="True" />
<Button Grid.Row="2" Width="80" Content="Do Something Else"
HorizontalAlignment="Right" Margin="5" />
</Grid>
When the DataGrid is short, the top and bottom rows are where I'd expect... at the top and bottom of the window with the center row taking up the rest of the visible space. When the DataGrid is too long, however, the bottom row is forced off-screen. Is there a way to have the DataGrid scroll when it is too long to fit in the visible space?
Setting the center row's height to a fixed value causes the DataGrid to scroll, but I want the height to be dynamic as the window is resized.
Any help is appreciated...
Thanks, Lou