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:FieldSettings CellHeight="25" AllowGroupBy="True"/>
<igDP:Field Name="WOOperation" Label="Operation">
<igDP:FieldSettings CellHeight="25" AllowGroupBy="True" >
</igDP:FieldSettings>
<igDP:Field Name="WOSubOperation" Label="Sub-Operation">
<igDP:Field Name="Location" Label="Location" >
<igDP:Field Name="Description" Label="Description">
<igDP:FieldSettings CellHeight="200" AllowGroupBy="True" >
<igDP:FieldSettings.EditorStyle>
<Style TargetType="{x:Type igEditors:XamTextEditor}">
<Setter Property="TextWrapping" Value="Wrap" />
</igDP:FieldSettings.EditorStyle>
<igDP:Field Name="ProjectedCost" Label="Projected Cost">
<igDP:FieldSettings CellHeight="25" AllowGroupBy="True" AllowSummaries="True" >
<Style TargetType="{x:Type igEditors:XamCurrencyEditor}"/>
<igDP:Field Name="ProjectedHours" Label="Projected Hours">
<igDP:FieldSettings CellHeight="25" AllowGroupBy="True" AllowSummaries="True">
<Style TargetType="{x:Type igEditors:XamTextEditor}"/>
<igDP:Field Name="ProjectedBilling" Label="Projected Billing">
<!-- -->
<igDP:Field Name="ActualCost" Label="Actual Cost">
<igDP:Field Name="ActualHours" Label="Actual Hours">
<igDP:FieldSettings CellHeight="25" AllowGroupBy="True">
<igDP:Field Name="ActualBilling" Label="Actual Billing">
</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}" />
<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}"/>
Height="18"
x:Name="PART_HorizontalScrollBar"
Visibility="{TemplateBinding ComputedHorizontalScrollBarVisibility}"
Grid.Column="0"
Orientation="Horizontal"
ViewportSize="{TemplateBinding ViewportWidth}"
Maximum="{TemplateBinding ScrollableWidth}"
Value="{TemplateBinding HorizontalOffset}"/>
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?
I have about 14K rows in the grid when this occurs, It is a List of objects returned from a Web Service. The only event tied to the grid right now is SelectedItemsChanged, and that doesn't appear to get called when the scrolling is occuring. I have not changed RecordContainerGenerationMode at all, Now that i am looking at it, it is set to Recycle, which i think is default right? I will try the other settings (Virtualized, LazyLoad, Preload) and let you know if that helps.
Ok I tried with and without AllowLabelVirtualization and AllowCellVirtualization, with the 4 settings in RecordContainerGenerationMode. I also tried the RecordLoadMode and CellContainerGenerationMode. Here is the numbers, none are good, and all do not qualify as "Blinding Performance" as advertized...
Preload results in a 4 SECOND DELAY With or Without cell,Label virtualization, recordLoadMode had no effect, CellContainerGenerationMode hd little effect
Virtualize took 3 seconds with or without cell,label virtualization, recordloadmode had minor effect, preload being slower
Recycle took 4 seconds, seems the other settings had little effect
I tried removing the theme, the image in the first column, ect, my scroll behaviour is still slow. The funny thing about it all is the interface is taken pretty much from the xamShowCase Sales app..The layout is the same, pretty much the only difference is the code behind, and i use a grid instead of DataPresenter.
There has to be something i am missing or these controls aren't really ready for production. I tried the same datasource, the same filtering, custom sorting in the default grid last night and it performed reasonably well, the sorting/filtering was a little slower, but at least the users could scroll....
No user i know of will tolorate a 3-4 second delay everytime they try to scroll
Ok I was getting an object in my list that was null because it is null in the database, so i removed it and tried again. The first chance exception went away, and my scroll behaviour improved, now there is only about half a second to a second delay.
Does the grid look fields marked internal? It seems that if i bind to a collection of objects of the same size without internal fields (just public properties), the scroll behaviour is normal.
The next thing would be to check if there are any exceptions, first chance exceptions in the Output window. There could be type mismatch and or type conversion.
As you see, the example in the XamShowCase has pretty decent performance, so I am still not sure where the problem is coming form. If you have a sample with this slow performance, you could attach it here so that we can look into it or contact developer support here and submit a sample there.