Note that there are some explanatory texts on larger screens.

plurals
  1. POWPF Scrollviewer starting position strange
    text
    copied!<p>i've got a window with 2 tabs each tab contain a Scrollviewer with same exact properties</p> <pre><code>&lt;ScrollViewer VerticalScrollBarVisibility="Auto" HorizontalAlignment="Stretch" VerticalAlignment="Stretch" CanContentScroll="False"&gt; &lt;Grid HorizontalAlignment="Stretch" VerticalAlignment="Stretch"&gt; &lt;Grid.RowDefinitions&gt; &lt;RowDefinition Height="Auto" /&gt; &lt;RowDefinition Height="*" /&gt; &lt;/Grid.RowDefinitions&gt; &lt;/Grid&gt; &lt;/ScrollViewer&gt; </code></pre> <p>the difference now :</p> <p>First Tab :</p> <p>the grid row 0 contain a <code>&lt;WrapPanel&gt;</code> with couple <code>&lt;StackPanel&gt;</code> inside where all controls are</p> <p>the grid row 1 contain a <code>&lt;DataGrid&gt;</code> that fill the rest and has a minimum height</p> <p>Second Tab :</p> <p>the grid row 0 contain a <code>WrapPanel</code> with couple <code>&lt;DockPanel&gt;</code> inside where all controls are</p> <p>the grid row 1 contain a <code>&lt;DataGrid&gt;</code> that fill the rest and has a minimum height</p> <p>The issue :</p> <p>when i open the window there is too much control to be viewed all at once so scroll bar or the <code>&lt;ScrollViewer&gt;</code> appear and this is perfect. BUT for some awkward reason the second tab the scroll bar is NOT at the top but like a bit more than 3/4 down the window. I wonder if anyone ha that issue before and might know what i forgot there ?</p> <p>what i've tried :</p> <ul> <li><p>named the <code>&lt;ScrollViewer&gt;</code> in question and call on the form load <code>MyScroll.ScrollToTop();</code> didn't work but i guess it's because the control doesn't exist yet.</p></li> <li><p>I tried adding the <code>GotFocus</code> event to the <code>&lt;TabItem&gt;</code> but this baby get triggered every time i also click a control within it. I actually found that funny when i first click a <code>&lt;ComboBox&gt;</code> towards the end of the window.</p></li> </ul> <p>After trying all that i found that starting on top when the <code>&lt;ScrollViewer&gt;</code> is fist viewed is what i want and wondering if there is a way to do this or if i am missing something.</p> <p>Secondly i actually would like the <code>&lt;ScrollViewer&gt;</code> to scroll back to top when the person navigate the <code>&lt;TabItem&gt;</code> my little go to top bug made me realize that i actually like that.</p> <p>User will rarely use more than 2 Tabs on that window so insanely perfomant solution not required</p> <p>Edit : I've found something. if i scroll back up my problematic tab and then witch o another tab and come back, the scroll return EXACTLY where it was bugged at. </p> <p>Note that i have no events anywhere just simple bindings on for selected value of combobox and text box. o yeah and datasource for the grid but empty for both tab at this time.</p> <p>I have 4 windows with the EXACT same formatting and only 1 tab out of 12 do that.</p> <p>Edit #2 : here the full xaml</p> <pre><code>&lt;syncfusion:ChromelessWindow x:Class="prjSelection.Crating.frmCratingWestManufacturers" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:local="clr-namespace:prjSelection.Crating" Title="West Crating" Height="640" Width="1024" UseNativeChrome="True" xmlns:syncfusion="http://schemas.syncfusion.com/wpf" syncfusion:SkinStorage.VisualStyle="Metro" ShowActivated="True" WindowStartupLocation="CenterScreen"&gt; &lt;Grid&gt; &lt;Grid Name="grdOverlay" HorizontalAlignment="Stretch" VerticalAlignment="Stretch" Background="Transparent" Panel.ZIndex="99999999" Visibility="Hidden" MinWidth="150" MinHeight="200"&gt; &lt;Rectangle HorizontalAlignment="Stretch" VerticalAlignment="Stretch" Fill="White" Opacity="0.8"&gt;&lt;/Rectangle&gt; &lt;StackPanel HorizontalAlignment="Center" VerticalAlignment="Center"&gt; &lt;Label HorizontalAlignment="Stretch" VerticalAlignment="Center" Content="Running Selection" FontSize="18" FontWeight="Bold"&gt;&lt;/Label&gt; &lt;syncfusion:SfBusyIndicator AnimationType="Gear" HorizontalAlignment="Stretch" VerticalAlignment="Stretch" ViewboxHeight="150" ViewboxWidth="150" VerticalContentAlignment="Center" /&gt; &lt;/StackPanel&gt; &lt;/Grid&gt; &lt;syncfusion:TabControlExt BorderThickness="0,2,0,0" Name="tab1" AllowDrop="False" Background="White" EnableLabelEdit="False" AllowDragDrop="False" CloseButtonType="Hide" DefaultContextMenuItemVisibility="Hidden" SelectOnCreatingNewItem="False" ShowTabItemContextMenu="False" ShowTabListContextMenu="False" SnapsToDevicePixels="True" TabPanelBackground="White" UseLayoutRounding="False" TabScrollButtonVisibility="Auto" TabVisualStyle="None" TabStripPlacement="Top" TabItemSelectedForeground="White" HorizontalAlignment="Stretch" VerticalAlignment="Stretch" HorizontalContentAlignment="Stretch"&gt; &lt;syncfusion:TabItemExt Header="File" Width="150" IconMargin="0" &gt; &lt;ScrollViewer VerticalScrollBarVisibility="Auto" HorizontalAlignment="Stretch" VerticalAlignment="Stretch" CanContentScroll="False"&gt; &lt;Grid HorizontalAlignment="Stretch" VerticalAlignment="Stretch"&gt; &lt;Grid.RowDefinitions&gt; &lt;RowDefinition Height="Auto" /&gt; &lt;RowDefinition Height="*" /&gt; &lt;/Grid.RowDefinitions&gt; &lt;WrapPanel Grid.Row="0" HorizontalAlignment="Stretch" VerticalAlignment="Top"&gt; &lt;StackPanel&gt; &lt;GroupBox Header="File Visual Properties" VerticalContentAlignment="Stretch" VerticalAlignment="Top" Name="grpFileVisualProperties"&gt; &lt;WrapPanel Orientation="Horizontal"&gt; &lt;DockPanel Height="25" LastChildFill="True" Width="220" Margin="2,2,0,0"&gt; &lt;Label Content="File Color" Height="25" Name="lblFileColor" /&gt; &lt;ComboBox DisplayMemberPath="Value" Height="25" ItemsSource="{Binding Path=File.Color}" Name="cboFileColor" SelectedItem="{Binding Path=File.SelectedColor, Mode=TwoWay}" Width="120" DockPanel.Dock="Right" /&gt; &lt;Label /&gt; &lt;/DockPanel&gt; &lt;/WrapPanel&gt; &lt;/GroupBox&gt; &lt;GroupBox Header="File Relative Properties" VerticalContentAlignment="Stretch" VerticalAlignment="Top" Name="grpFileRelativeProperties"&gt; &lt;WrapPanel Orientation="Horizontal"&gt; &lt;DockPanel Height="25" LastChildFill="True" Width="280" Margin="2,2,0,0"&gt; &lt;Label Content="File Type" Height="25" Name="lblFileType" /&gt; &lt;ComboBox DisplayMemberPath="Value" Height="25" ItemsSource="{Binding Path=File.FileType}" Name="cboFileType" SelectedItem="{Binding Path=File.SelectedFileType, Mode=TwoWay}" Width="120" DockPanel.Dock="Right" /&gt; &lt;Label /&gt; &lt;/DockPanel&gt; &lt;/WrapPanel&gt; &lt;/GroupBox&gt; &lt;/StackPanel&gt; &lt;/WrapPanel&gt; &lt;Grid Grid.Row="1" HorizontalAlignment="Stretch" Name="grid2" VerticalAlignment="Stretch"&gt; &lt;Grid.ColumnDefinitions&gt; &lt;ColumnDefinition Width="1*" /&gt; &lt;ColumnDefinition Width="10" /&gt; &lt;ColumnDefinition Width="Auto" /&gt; &lt;/Grid.ColumnDefinitions&gt; &lt;Button Content="Run Selection" FontSize="20" FontStretch="Normal" Height="46" Name="cmdFileSelection" Padding="0" Width="198.162" Canvas.Left="793.838" Canvas.Top="410" VerticalAlignment="Top" Grid.Column="2" /&gt; &lt;syncfusion:SfDataGrid AllowGrouping="False" AllowResizingColumns="False" AllowSorting="False" ColumnSizer="Auto" FontSize="13" GroupRowSelectionBrush="{x:Null}" ItemsSource="{Binding Path=File.ResultGrid}" Name="grdFileData" NavigationMode="Cell" ShowColumnWhenGrouped="False" VerticalContentAlignment="Stretch" Canvas.Left="898.447" Canvas.Top="462" HorizontalAlignment="Left" Grid.Column="0" MinHeight="120" MinWidth="120" /&gt; &lt;/Grid&gt; &lt;/Grid&gt; &lt;/ScrollViewer&gt; &lt;/syncfusion:TabItemExt&gt; &lt;syncfusion:TabItemExt Header="Box" Width="150" IconMargin="0"&gt; &lt;ScrollViewer VerticalScrollBarVisibility="Auto" HorizontalAlignment="Stretch" VerticalAlignment="Stretch" CanContentScroll="False"&gt; &lt;Grid HorizontalAlignment="Stretch" VerticalAlignment="Stretch"&gt; &lt;Grid.RowDefinitions&gt; &lt;RowDefinition Height="Auto" /&gt; &lt;RowDefinition Height="*" /&gt; &lt;/Grid.RowDefinitions&gt; &lt;WrapPanel Grid.Row="0" HorizontalAlignment="Stretch" Orientation="Horizontal"&gt; &lt;DockPanel Height="25" Width="375" Margin="2,2,0,0"&gt; &lt;Label Content="Height" Name="lblHeight" Height="25" /&gt; &lt;ComboBox ItemsSource="{Binding Path=Box.Height}" SelectedItem="{Binding Path=Box.SelectedHeight, Mode=TwoWay}" DisplayMemberPath="Value" Name="cboHeight" Width="200" Height="25" DockPanel.Dock="Right" /&gt; &lt;Label /&gt; &lt;/DockPanel&gt; &lt;/WrapPanel&gt; &lt;Grid Grid.Row="1" HorizontalAlignment="Stretch" VerticalAlignment="Stretch"&gt; &lt;Grid.ColumnDefinitions&gt; &lt;ColumnDefinition Width="1*" /&gt; &lt;ColumnDefinition Width="10" /&gt; &lt;ColumnDefinition Width="Auto" /&gt; &lt;/Grid.ColumnDefinitions&gt; &lt;Button Content="Run Selection" FontSize="20" FontStretch="Normal" Height="46" Name="cmdBoxSelection" Padding="0" Width="198.162" Canvas.Left="793.838" Canvas.Top="410" VerticalAlignment="Top" Grid.Column="2" /&gt; &lt;syncfusion:SfDataGrid AllowGrouping="False" AllowResizingColumns="False" AllowSorting="False" ColumnSizer="Auto" FontSize="13" GroupRowSelectionBrush="{x:Null}" ItemsSource="{Binding Path=Box.ResultGrid}" Name="grdBoxData" NavigationMode="Cell" ShowColumnWhenGrouped="False" VerticalContentAlignment="Stretch" Canvas.Left="898.447" Canvas.Top="462" HorizontalAlignment="Left" Grid.Column="0" MinHeight="120" MinWidth="120" /&gt; &lt;/Grid&gt; &lt;/Grid&gt; &lt;/ScrollViewer&gt; &lt;/syncfusion:TabItemExt&gt; &lt;/syncfusion:TabControlExt&gt; &lt;/Grid&gt; </code></pre> <p></p> <p><img src="https://i.stack.imgur.com/4x9J3.png" alt="enter image description here"></p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload