Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
100
Xaml Grid - Horizontal Scrolling
posted

Hi,

i have a hierarchical grid (Xamgrid) with 2 header rows and many columns (> 200). I use grouped header columns and normal header columns mixed.

Now the problem:

When I scroll horizontally with the mouse, I don't get to the last column. Instead it ends somewhere in the middle.
With the keyboard I can scroll further.

To get around this, I scroll to the last column and back by code. But then columns are missing in the middle.

It looks like this could be related to virtualization.

Do you know this problem?
And do you have any idea how to make scrolling with the mouse stable?

greetings

Thomas


 <ig:XamGrid 	x:Name="view"                    
							AutoGenerateColumns="false"
							Background="{DynamicResource {x:Static UiCore:Brushes.WhiteColorBrush}}"
							BorderThickness="0"                    
							CellStyle="{DynamicResource HorizontalGaplessCellControlStyle}"
							ColumnWidth="Auto"
							ContextMenu="{DynamicResource ViewModelContextMenu}"
							DataContext="{Binding}"
							FixedRowSeparatorStyle="{DynamicResource FixedRowSeparatorStyle}"
							HeaderTextHorizontalAlignment="Center"
							Indentation="0"
							IsAlternateRowsEnabled="False"
							ItemsSource="{Binding SubElements}" 
							KeyboardNavigation="AllLayouts"
							MinimumRowHeight="{DynamicResource {x:Static UiCore:Constants.RasterHeight4Constant}}"
							RowHover="Row"                        
							CellControlGenerationMode="Virtualize"                                 
							ColumnResized="view_ColumnResized"
							ScrollBar.Scroll="view_Scroll">

                <ig:XamGrid.Style>
                    <Style BasedOn="{StaticResource {x:Type ig:XamGrid}}"
                       TargetType="{x:Type ig:XamGrid}">
                        <Style.Triggers>
                            <DataTrigger Binding="{Binding HasCustomizedGridColumns}"
                                     Value="False">
                                <Setter Property="IsEnabled"
                                        Value="False" />
                                <Setter Property="Opacity"
                                        Value="0.5" />
                            </DataTrigger>

                            <DataTrigger Binding="{Binding SubElements.Count}"
                                         Value="0">
                                <Setter Property="IsEnabled"
                                        Value="False" />
                                <Setter Property="Opacity"
                                        Value="0.5" />
                            </DataTrigger>

                        </Style.Triggers>
                    </Style>

                </ig:XamGrid.Style>

                <ig:XamGrid.ColumnLayouts>
                    <ig:ColumnLayout Key="SubElements" 
                                     TargetTypeName="RowViewModel"></ig:ColumnLayout> 
                </ig:XamGrid.ColumnLayouts>
           
                <ig:XamGrid.SortingSettings>
                    <ig:SortingSettings AllowSorting="False" />
                </ig:XamGrid.SortingSettings>

                <ig:XamGrid.ColumnResizingSettings>
                    <ig:ColumnResizingSettings AllowColumnResizing="Immediate"
                                               AllowDoubleClickToSize="False"
                                               AllowMultipleColumnResize="False" />
                </ig:XamGrid.ColumnResizingSettings>

                <ig:XamGrid.EditingSettings>
                    <ig:EditingSettings AllowEditing="None"
                                        IsEnterKeyEditingEnabled="False"
                                        IsF2EditingEnabled="False"
                                        IsMouseActionEditingEnabled="None"
                                        IsOnCellActiveEditingEnabled="False" />
                </ig:XamGrid.EditingSettings>
								
								<ig:XamGrid.SelectionSettings>
                    <ig:SelectionSettings CellSelection="Multiple" />
                </ig:XamGrid.SelectionSettings>
</ig:XamGrid>