I think you are after something like this (But with DataGrids
instead of simple TextBlocks
- I currenty only have access to Kaxaml, but the basic idea is the same):

Here is the XAML for that (without the full lorem ipsum part):
<Grid x:Name="grid" Height="400" Width="350">
<Grid.RowDefinitions>
<RowDefinition Height="auto" />
<RowDefinition x:Name="normalRow" Height="*"/>
</Grid.RowDefinitions>
<TextBlock x:Name="Frozen" Grid.Row="0"
MaxHeight="{Binding Path=Height, ElementName=grid}"
Background="LightBlue" TextWrapping="Wrap" Padding="5">
Lorem ipsum dolor...
</TextBlock>
<ScrollViewer x:Name="Normal" Grid.Row="1"
MaxHeight="{Binding Path=Height, ElementName=normalRow}" >
<TextBlock Margin="5" TextWrapping="Wrap">
Lorem ipsum dolor...
</TextBlock>
</ScrollViewer>
</Grid>
The main idea is to name the RowDefinition
, and bind the "Normal" part's Height
to it's Height
property, while binding the first row's MaxHeight
to the Height
of the Grid
.
A common "trick" I often use: name your UserControl
(e.g.: x:Name="Instance"
), that way you can easily bind to it's properties, in this case the Width
and Height
of the outermost Grid
control.
Update:
The problem that the content of the first row gets cut if you size the control to a small enough size could be fixed by introducing a MaxHeight
to that RowDefinition
, and binding it to the Height
of the Grid
itself, but unfortunately it seems that setting a RowDefinition
's Heigth
to Auto
causes it to disregard any MaxHeight
setting (see this question)...
But here is a workaround:
<UserControl x:Name="instance">
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="Auto" />
<RowDefinition x:Name="normalRow" Height="*"/>
</Grid.RowDefinitions>
<ScrollViewer x:Name="Frozen" Grid.Row="0"
ScrollViewer.VerticalScrollBarVisibility="Auto"
MaxHeight="{Binding ElementName=instance, Path=Height}">
<TextBlock x:Name="test" Background="LightBlue" TextWrapping="Wrap" Padding="5" >
Lorem ipsum dolor ...
</TextBlock>
</ScrollViewer>
<ScrollViewer x:Name="Normal" Grid.Row="1"
ScrollViewer.VerticalScrollBarVisibility="Auto"
MaxHeight="{Binding Path=Height, ElementName=normalRow}" >
<TextBlock Margin="5" TextWrapping="Wrap">
Lorem ipsum dolor ...
</TextBlock>
</ScrollViewer>
</Grid>
</UserControl>
The trick is to bind the first column's content's MaxHeight
to the Height of the UserControl
.
Of course in your case the ScrollViewers
are not really needed as the DataGrid
has built-in scrollbars, but I hope you get the idea.