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>