In my WPF-Application I have a window which contains many dynamic DataGrid with a Label on top as the heading line. These Elements are children of an ScrollViewer. If I scroll up or down the ScrollViewer always jump to the Label. From the Content of the DataGrids only the first columns are visible. My WPF-Code:
<ScrollViewer CanContentScroll="True" PanningMode="VerticalFirst" MouseWheel="ResultDataGrid_OnMouseWheel" x:Name="ResultScrollViewer" Height="Auto">
<StackPanel x:Name="ResultStackPanel">
<TextBlock Text="Result" Style="{StaticResource Heading2}" />
<StackPanel Style="{StaticResource ResultStackPanel}">
<Label Content="Informations" x:Name="LabelInfo" Style="{StaticResource BoldLabel}"/>
<DataGrid x:Name="ResultMeta" Style="{StaticResource DataGridStyle}" />
</StackPanel>
<StackPanel Style="{StaticResource ResultStackPanel}">
<Label Content="Statistics" Style="{StaticResource BoldLabel}"/>
<DataGrid x:Name="ResultStat" Style="{StaticResource DataGridStyle}" />
</StackPanel>
<StackPanel Style="{StaticResource ResultStackPanel}">
<Label Content="Resources" Style="{StaticResource BoldLabel}" />
<DataGrid x:Name="ResultResources" Style="{StaticResource DataGridStyle}" />
</StackPanel>
<!-- ... -->
</StackPanel>
</ScrollViewer>