Hi there
Another issue with 7.2 that's not resolved yet: Sometimes it appears that certain cells are being skipped during rendering. I assume this the same or related to the issue that causes records to be rendered with the wrong data (e.g. record X displays a single cell value of a styled cell that belongs to record Y). As far as I can tell, it only affects templated cells that use a CellValuePresenter but I wouldn't bet my life on it.
Here's a sample screenshot of the issue:
Some more information:
Hi Philipp
That is very strange. I am wondering if it has something to do with our recycling of elements. Try setting the grid's RecordContainerGenerationMode and/or CellContainerGenerationMode properties to 'Virtualize' or 'LazyLoad' to see if the problem goes away. Either way if you could provide a small sample app that demonstrates the problem I can take a look.
Thanks.
Hi Joe
I'm sorry but I have no idea how to create a sample for this. I experienced the issue on another grid a while ago and threw the feature out in order to prevent it (deadline issues). In that case, I had cells displaying values of other records - e.g. the Name cell for record X and Y showed the name of record X on both cells, as if the binding{Binding RelativeSource={RelativeSource TemplatedParent}, Path=Record.DataItem.XXX}had returned the same record twice.
And for the current sample, I don't know how to reproduce it at all - it just happens sometimes and it's completely random. This might however be related to the other CellValuePresenter issue I'm trying to post about (my postings don't get through because of the approval bug in the forum). Maybe the information of both postings combined can point you to the right direction.
Here's the markup of the grid and the styles of the first two cells:
<igDP:XamDataGrid x:Name="groupGrid" Grid.Row="0" Background="{StaticResource GridEditorBrush}" Theme="Onyx"> <igDP:XamDataGrid.FieldLayouts> <igDP:FieldLayout> <igDP:FieldLayout.Settings> <igDP:FieldLayoutSettings AutoGenerateFields="False" RecordSelectorLocation="Default" /> </igDP:FieldLayout.Settings> <igDP:FieldLayout.Fields> <igDP:UnboundField Name="Tools" Label=""> <igDP:Field.Settings> <igDP:FieldSettings AllowEdit="False" CellClickAction="SelectRecord" CellValuePresenterStyle="{StaticResource Grid_EditorTool}" AllowGroupBy="False" LabelWidth="0" LabelMinWidth="0" LabelMaxWidth="0" CellWidth="30" AllowResize="False" /> </igDP:Field.Settings> </igDP:UnboundField> <igDP:Field Name="EditStatus" Label=""> <igDP:Field.Settings> <igDP:FieldSettings AllowEdit="False" CellClickAction="SelectRecord" CellValuePresenterStyle="{StaticResource Grid_EditStatusCellPresenter}" LabelMinWidth="30" LabelMaxWidth="30" CellMinWidth="30" CellMaxWidth="30" /> </igDP:Field.Settings> </igDP:Field> <!-- the sync status field is only displayed if EditMode is set to synchronization --> <igDP:Field Name="SyncStatus" Visibility="{Binding Source={StaticResource Data_ProjectController}, Path=EditMode, Converter={StaticResource Control_SyncModeToVisibilityConverter}}" Label="Sync Status"> <igDP:Field.Settings> <igDP:FieldSettings AllowEdit="False" CellClickAction="SelectRecord" CellValuePresenterStyle="{StaticResource Grid_SyncStatusCellPresenter}" LabelMinWidth="130" LabelMaxWidth="130" CellMinWidth="130" CellMaxWidth="130" /> </igDP:Field.Settings> </igDP:Field> <igDP:UnboundField Name="ResolvedName" Label="Default Name" BindingPath="Localizations[0].LocalizedName" BindingMode="TwoWay" IsScrollTipField="True"> <igDP:Field.Settings> <igDP:FieldSettings AllowGroupBy="False" AllowEdit="True" LabelMinWidth="200" LabelMaxWidth="200" CellMinWidth="200" CellMaxWidth="200" /> </igDP:Field.Settings> </igDP:UnboundField> <igDP:Field Name="QualifiedName" Label="Qualified Name"> <igDP:Field.Settings> <igDP:FieldSettings AllowEdit="{Binding Source={StaticResource Data_ProjectController}, Path=IsEditMode}" CellValuePresenterStyle="{StaticResource Grid_LongTextCellPresenter}" AllowGroupBy="False" LabelMinWidth="100" LabelMaxWidth="600" CellWidth="300" CellMinWidth="100" CellMaxWidth="600" /> </igDP:Field.Settings> </igDP:Field> <igDP:UnboundField Name="ParentGroupName" Label="Parent Group" BindingPath="ParentGroup.Localizations[0].LocalizedName" BindingMode="OneWay"> <igDP:Field.Settings> <igDP:FieldSettings AllowGroupBy="False" AllowEdit="False" CellClickAction="SelectRecord" LabelMinWidth="160" LabelMaxWidth="160" CellMinWidth="160" CellMaxWidth="160" /> </igDP:Field.Settings> </igDP:UnboundField> <!-- only allow source ID editing if we're not in sync mode --> <igDP:Field Name="SourceId" Label="Source"> <igDP:Field.Settings> <igDP:FieldSettings AllowEdit="{Binding Source={StaticResource Data_ProjectController}, Path=IsEditMode}" EditorType="{x:Type igEditors:XamComboEditor}" EditorStyle="{StaticResource Grid_SourcesList}" LabelMinWidth="60" LabelMaxWidth="60" CellMinWidth="60" CellMaxWidth="60" /> </igDP:Field.Settings> </igDP:Field> <igDP:Field Name="GroupId" Label="Group ID"> <igDP:Field.Settings> <igDP:FieldSettings AllowGroupBy="False" AllowEdit="False" CellClickAction="SelectRecord" LabelMinWidth="80" LabelMaxWidth="80" CellMinWidth="80" CellMaxWidth="80" /> </igDP:Field.Settings> </igDP:Field> </igDP:FieldLayout.Fields> </igDP:FieldLayout> </igDP:XamDataGrid.FieldLayouts> </igDP:XamDataGrid>
<!-- style for the first cell (the red pen) --> <Style x:Key="Grid_EditorTool" TargetType="{x:Type igDP:CellValuePresenter}"> <Setter Property="Template"> <Setter.Value> <ControlTemplate TargetType="{x:Type igDP:CellValuePresenter}"> <StackPanel Orientation="Horizontal" HorizontalAlignment="Center"> <Button Command="cmd:CtmsCommands.EditCommand" ContextMenu="{StaticResource EditorContextMenu}" Cursor="Hand" Width="24" HorizontalContentAlignment="Center"> <Button.Template> <ControlTemplate TargetType="{x:Type Button}"> <Image Source="/Shared/Images/Edit.png" ToolTip="Right-click for more options." VerticalAlignment="Center" HorizontalAlignment="Center" Width="16" Height="16" Margin="2,0,2,0"/> </ControlTemplate> </Button.Template> </Button> </StackPanel> </ControlTemplate> </Setter.Value> </Setter> </Style>
<!-- style for the second cell --> <Style x:Key="Grid_EditStatusCellPresenter" TargetType="{x:Type igDP:CellValuePresenter}"> <Setter Property="Template"> <Setter.Value> <ControlTemplate TargetType="{x:Type igDP:CellValuePresenter}"> <StackPanel Orientation="Horizontal" HorizontalAlignment="Center"> <Image Source="{Binding RelativeSource={RelativeSource TemplatedParent}, Path=Record.DataItem.EditStatus, Converter={StaticResource Control_EditStatusToImageConverter}}" VerticalAlignment="Center" HorizontalAlignment="Center" Width="16" Height="16" Margin="2,0,2,0"> <Image.ToolTip> <ToolTip> <StackPanel Orientation="Horizontal"> <TextBlock Text="Editor Status: " /> <TextBlock Margin="2,0,0,0" Text="{Binding RelativeSource={RelativeSource TemplatedParent}, Path=Record.DataItem.EditStatus}" /> </StackPanel> </ToolTip> </Image.ToolTip> </Image> </StackPanel> </ControlTemplate> </Setter.Value> </Setter> </Style>
Do you notice any binding errors in the output window?
One thing you might want to try is to change the bindings slightly in the CellValuePresenter styles to take advantage of the fact that the DataContext of the CVP is set to the DataRecord. e.g.
instead of
<Image Source="{Binding RelativeSource={RelativeSource TemplatedParent}, Path=Record.DataItem.EditStatus,Converter={StaticResource Control_EditStatusToImageConverter}}"
try this:
<Image Source="{Binding Path=(DataItem).EditStatus, Converter={StaticResource Control_EditStatusToImageConverter}}"
We are having similar issues with rendering (alternate styled rows not showing right, etc.) that seem to get solved by changing the RecordContainerGenerationMode, but I can't find this property in the online docs. Can you explain the modes?
Thx
Matt,
The reason that the property wasn't in the docs is because it was something that was added after the initial release of 7.1.
One of the problems that we had encountered with the initial release was that scrolling perfomance was not good in many scenarios (e.g. when there was a significant number of cells per record). This was caused by the amount of time it took to hydrate new elements that would make up the visual tree for each new cell and record as they were scrolled into view, and then these elements were discarded as old records were scrolled out of view.
Therefore, in the last major hotfix we added the concept of element recycling, which is turned on by default. This dramatically improved scrolling performance since we were reusing existing element trees, and just changing their DataContext (i.e the DataContext of a RecordPresenter is its associated Record object).
The problem that you encountered, that we have since fixed, was that we weren't synching up the IsAlternate property on the RecordPresenter when its DataContext changed. By turning off element recycling for records you eliminate the problem.
We did have the foresight to add 2 properties to control this behavior RecordContainerGenerationMode and CellContainerGenerationMode. Here is what the enumeration values mean:
I hope this helps.
Btw, can you comment on the release date for all these (wonderful ) fixes?
That's great, thanks very much (out of convenience, was posting as another user (mattwaldron -- was cached in IE) -- got off my tuckus a minute ago and registered).
Thx again... D