Hello,
I have a custom pager which I don't want replicated in the group items pagers.
It works fine initially but when I sort then the custom pager jumps into a group item pager.
Here are the steps to replicate it.
In the XamGrid -> Style -> PagerCustomization.xaml
in the template
under
<TextBlock TextAlignment="Center" VerticalAlignment="Center" Text="{Binding TotalPages}" Foreground="{StaticResource ForegroundBrush}" />
add
<TextBlock x:Name="test" Text="test" Style="{StaticResource akis1}" />
in the resourceDictionary add
<Style TargetType="TextBlock" x:Key="akis1"> <Setter Property="Visibility" Value="Hidden"/> <Setter Property="Background" Value="Yellow" /> <!-- this is the one --> <Style.Triggers> <DataTrigger Binding="{Binding RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type igPrim:PagerCellsPanel}}, Path=Row.Manager.ParentRow}" Value="{x:Null}"> <Setter Property="Visibility" Value="Visible"/> <Setter Property="Background" Value="Red" /> </DataTrigger> </Style.Triggers>
</Style>Thanks,Akis
Hello Akis,
Thank you for your update. Using your steps, I was able to reproduce the behavior you are seeing.
After doing some experimentation with the sample project I sent you, it appears that this behavior is happening due to a cross of the virtualization / recycling of the PagerCellControl and the DataTrigger not firing on sort. I found this by moving the DataTrigger-related binding out to a converter binding for Visibility on the “test” TextBlock. I found that the converter only fired once, which means that the visibility was never re-evaluated, but the PagerCellControl was recycling to be in a different spot each time, and this is why the behavior was an issue.
Something I found is that the PagerCellControl.Cell property was changing with each sort, though, and so I changed the binding in the DataTrigger to be the following:
“{Binding RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type igPrim:PagerCellControl}}, Path=Cell.Row.Manager.ParentRow}”
This appears to work. I am attaching a modified version of the sample project I sent you to demonstrate.
I hope this helps you. Please let me know if you have any other questions or concerns on this matter.
1526.XamGridPagingSampleIsolated.zip
Hi Andrew,
thanks for looking at it.
The sample problem does demonstrate the issue.
Steps to reproduce:
1. Load the app
2. see the red "test" next to the paging dropdown
3. Group by country
4. expand Italy and Spain
5. Sort by name (by clicking in Italy's Name column header)
6. See that the red "test" has moved from the main paging control to the Spain's one
Hope that makes it clear.
Thanks,
Akis
I have put together a sample project to isolate the Samples Browser sample that you are referring to, but I am a little bit unsure of the exact behavior you are seeing when you say that the custom pager is “jumping to a group item pager” on sort of the grid. Perhaps you are grouping the grid instead? Still, in doing so, I am not entirely sure I understand the issue you are seeing.
Can you please take a look at the sample project I am attaching and elaborate a little bit on the exact behavior you are seeing and the behavior that you want to prevent? The only real difference between this sample and the one in the browser is the supplied data source.
Please let me know if you have any other questions or concerns on this matter.
XamGridPagingSampleIsolated.zip