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
360
Scroll Behaviour
posted

I finally got the records to scroll in my xamDataGrid by removing a style, i am not sure why the style affects the scroll behavior though.  I have included it below in case anyone can see a problem with it. 

My next question is how to get the scrolling smooth.  It takes several seconds from the time i click the scroll until the records change.  I have all virtualization turned off hoping that would help, but it didn't make a difference.  My xaml for the grid is also below:

<!-- GRID -->

<igDP:XamDataGrid Name="grid" Theme="ForestGreen" AutoFit="True" SelectedItemsChanged="grid_SelectedItemsChanged" >

            <igDP:XamDataGrid.FieldSettings >

                <igDP:FieldSettings  CellClickAction="SelectRecord" AllowEdit="False" AllowSummaries="True" AllowGroupBy="True" AllowCellVirtualization="False" LabelTextWrapping="WrapWithOverflow" SummaryDisplayArea="BottomFixed" />

            </igDP:XamDataGrid.FieldSettings>

             <igDP:XamDataGrid.Resources>                           

                <Style TargetType="{x:Type igDP:CellValuePresenter}" x:Key="ScheduleImageCellStyle">

                    <Setter Property="Template">

                        <Setter.Value>

                            <ControlTemplate TargetType="{x:Type igDP:CellValuePresenter}">

                                <Grid Width="70" Height="70" Margin="2">

                                    <Border BorderBrush="#DDDDDD" BorderThickness="1" HorizontalAlignment="Center" VerticalAlignment="Center">

                                        <Image Width="32" MaxHeight="64" MaxWidth="64" Source="{Binding RelativeSource={RelativeSource TemplatedParent}, Path=Content}" />

                                    </Border>

                                </Grid>

                            </ControlTemplate>

                        </Setter.Value>

                    </Setter>

                </Style>

           

            </igDP:XamDataGrid.Resources>

            <igDP:XamDataGrid.FieldLayoutSettings>

                <igDP:FieldLayoutSettings AutoGenerateFields="False" />

            </igDP:XamDataGrid.FieldLayoutSettings>

            <igDP:XamDataGrid.FieldLayouts>

                <igDP:FieldLayout>

                    <igDP:FieldLayout.FieldSettings>

                        <igDP:FieldSettings AllowEdit="False" CellClickAction="SelectRecord" />

                    </igDP:FieldLayout.FieldSettings>

                    <igDP:FieldLayout.Fields>

                        <igDP:Field Name="ImageFile"  Label="Budget Status">                           

                            <igDP:Field.Settings>

                                <igDP:FieldSettings CellHeight="64" CellWidth="64"

                                            CellValuePresenterStyle="{StaticResource ScheduleImageCellStyle}"

                                            CellMaxWidth="100" LabelMaxWidth="100"/>

                            </igDP:Field.Settings>                           

                        </igDP:Field>                      

                        <igDP:Field Name="WorkOrder" Label="Work Order">

                            <igDP:Field.Settings>

                                <igDP:FieldSettings CellHeight="25"   AllowGroupBy="True"/>

                            </igDP:Field.Settings>

                        </igDP:Field>

                        <igDP:Field Name="WOOperation" Label="Operation">

                            <igDP:Field.Settings>

                                <igDP:FieldSettings CellHeight="25" AllowGroupBy="True" >                                   

                                </igDP:FieldSettings>

                            </igDP:Field.Settings>                           

                        </igDP:Field>

                        <igDP:Field Name="WOSubOperation" Label="Sub-Operation">

                            <igDP:Field.Settings>

                                <igDP:FieldSettings CellHeight="25" AllowGroupBy="True" >                                   

                                </igDP:FieldSettings>

                            </igDP:Field.Settings>

                        </igDP:Field>

 

                        <igDP:Field Name="Location" Label="Location" >

                            <igDP:Field.Settings>

                                <igDP:FieldSettings CellHeight="25" AllowGroupBy="True" >

                                </igDP:FieldSettings>

                            </igDP:Field.Settings>

                        </igDP:Field>

 

                        <igDP:Field Name="Description" Label="Description">

                            <igDP:Field.Settings>

                                <igDP:FieldSettings CellHeight="200" AllowGroupBy="True" >

                                    <igDP:FieldSettings.EditorStyle>

                                        <Style TargetType="{x:Type igEditors:XamTextEditor}">

                                            <Setter Property="TextWrapping" Value="Wrap" />

                                        </Style>

                                    </igDP:FieldSettings.EditorStyle>

                                </igDP:FieldSettings>

                            </igDP:Field.Settings>

                        </igDP:Field>

                        <igDP:Field Name="ProjectedCost" Label="Projected Cost">

                            <igDP:Field.Settings>

                                <igDP:FieldSettings CellHeight="25" AllowGroupBy="True" AllowSummaries="True" >

                                    <igDP:FieldSettings.EditorStyle>

                                        <Style TargetType="{x:Type igEditors:XamCurrencyEditor}"/>                                          

                                    </igDP:FieldSettings.EditorStyle>

                                </igDP:FieldSettings>

                            </igDP:Field.Settings>

                        </igDP:Field>

                        <igDP:Field Name="ProjectedHours" Label="Projected Hours">

                            <igDP:Field.Settings>

                                <igDP:FieldSettings CellHeight="25" AllowGroupBy="True" AllowSummaries="True">

                                    <igDP:FieldSettings.EditorStyle>

                                        <Style TargetType="{x:Type igEditors:XamTextEditor}"/>

                                    </igDP:FieldSettings.EditorStyle>

                                </igDP:FieldSettings>

                            </igDP:Field.Settings>

                        </igDP:Field>

                        <igDP:Field Name="ProjectedBilling" Label="Projected Billing">

                            <igDP:Field.Settings>

                                <igDP:FieldSettings CellHeight="25" AllowGroupBy="True" AllowSummaries="True" >

                                    <igDP:FieldSettings.EditorStyle>

                                        <Style TargetType="{x:Type igEditors:XamCurrencyEditor}"/>

                                    </igDP:FieldSettings.EditorStyle>

                                </igDP:FieldSettings>

                            </igDP:Field.Settings>

                        </igDP:Field>

                        <!-- -->

                        <igDP:Field Name="ActualCost" Label="Actual Cost">

                            <igDP:Field.Settings>

                                <igDP:FieldSettings CellHeight="25" AllowGroupBy="True" AllowSummaries="True">

                                    <igDP:FieldSettings.EditorStyle>

                                        <Style TargetType="{x:Type igEditors:XamCurrencyEditor}"/>

                                    </igDP:FieldSettings.EditorStyle>

                                </igDP:FieldSettings>

                            </igDP:Field.Settings>

                        </igDP:Field>

                        <igDP:Field Name="ActualHours" Label="Actual Hours">

                            <igDP:Field.Settings>

                                <igDP:FieldSettings CellHeight="25" AllowGroupBy="True">

                                    <igDP:FieldSettings.EditorStyle>

                                        <Style TargetType="{x:Type igEditors:XamTextEditor}"/>

                                    </igDP:FieldSettings.EditorStyle>

                                </igDP:FieldSettings>

                            </igDP:Field.Settings>

                        </igDP:Field>

                        <igDP:Field Name="ActualBilling" Label="Actual Billing">

                            <igDP:Field.Settings>

                                <igDP:FieldSettings CellHeight="25" AllowGroupBy="True">

                                    <igDP:FieldSettings.EditorStyle>

                                        <Style TargetType="{x:Type igEditors:XamCurrencyEditor}"/>

                                    </igDP:FieldSettings.EditorStyle>

                                </igDP:FieldSettings>

                            </igDP:Field.Settings>

                        </igDP:Field>

                    </igDP:FieldLayout.Fields>

                </igDP:FieldLayout>

            </igDP:XamDataGrid.FieldLayouts>

        </igDP:XamDataGrid>

 

 

<!--- ScrollViewer Style that messes up scroll behaviour -->

 

<Style  TargetType="ScrollViewer">

        <Setter Property="HorizontalContentAlignment"

            Value="Left" />

        <Setter Property="VerticalContentAlignment"

            Value="Top" />

        <Setter Property="Padding"

            Value="4" />

        <Setter Property="BorderThickness"

            Value="1" />

        <Setter Property="BorderBrush"

            Value="{StaticResource NormalBorderBrush}" />

        <Setter Property="Template">

            <Setter.Value>

                <ControlTemplate TargetType="ScrollViewer">

                    <Border BorderBrush="{TemplateBinding BorderBrush}"

                  BorderThickness="{TemplateBinding BorderThickness}"

                  CornerRadius="2">

                        <Grid Background="{TemplateBinding Background}">

                            <Grid.ColumnDefinitions>

                                <ColumnDefinition Width="*" />

                                <ColumnDefinition Width="Auto" />

                            </Grid.ColumnDefinitions>

                            <Grid.RowDefinitions>

                                <RowDefinition Height="*" />

                                <RowDefinition Height="Auto" />

                            </Grid.RowDefinitions>

                            <ScrollContentPresenter Cursor="{TemplateBinding Cursor}"

                                      Margin="{TemplateBinding Padding}"

                                      x:Name="ScrollContentPresenter"

                                      ContentTemplate="{TemplateBinding ContentTemplate}" />

                            <Rectangle Grid.Column="1"

                         Grid.Row="1"

                         Fill="#FFE9EEF4" />

                            <ScrollBar IsTabStop="False"

                         x:Name="PART_VerticalScrollBar"

                         Width="18"

                         Visibility="{TemplateBinding ComputedVerticalScrollBarVisibility}"

                         Grid.Column="1"

                         Grid.Row="0"

                         Orientation="Vertical"

                         ViewportSize="{TemplateBinding ViewportHeight}"

                         Maximum="{TemplateBinding ScrollableHeight}"

                         Minimum="0"

                         Value="{TemplateBinding VerticalOffset}"/>

                            <ScrollBar IsTabStop="False"

                         Height="18"

                         x:Name="PART_HorizontalScrollBar"

                         Visibility="{TemplateBinding ComputedHorizontalScrollBarVisibility}"

                         Grid.Column="0"

                         Grid.Row="1"

                         Orientation="Horizontal"

                         ViewportSize="{TemplateBinding ViewportWidth}"

                         Maximum="{TemplateBinding ScrollableWidth}"

                         Minimum="0"

                         Value="{TemplateBinding HorizontalOffset}"/>

                        </Grid>

                    </Border>

                </ControlTemplate>

            </Setter.Value>

        </Setter>

    </Style>

Parents
  • 69686
    posted

    Hello,

    The record virtualization is turned on/off through the RecordContainerGenerationMode property of the XamDataGrid, but I do think that this is the reason. How big is your data source? How many records do you have in it? Have you changed the RecordContainerGenerationMode proeprty? Do you have heavy performance code in events that are fired frequently - like RecordsInViewChanged, InitializeRecord, etc?

Reply Children