I'm using a VirtualizingWrapPanel as the ItemsPanelTemplate of a RadListBox
<telerik:RadListBox x:Name="ItemControl"
Grid.Row="1"
VirtualizingPanel.ScrollUnit="Pixel"
ItemsSource="{Binding RelativeSource={RelativeSource AncestorType={x:Type local:UserControl}}, Path=PathName}">
<telerik:RadListBox.ItemsPanel>
<ItemsPanelTemplate>
<telerik:VirtualizingWrapPanel HorizontalAlignment="Center" ItemWidth="200" ItemHeight="180"/>
</ItemsPanelTemplate>
</telerik:RadListBox.ItemsPanel>
The ItemsSource is a ListCollectionView which is Live updating
ListCollectionView = new(Models);
ListCollectionView.IsLiveSorting = true;
ListCollectionView.SortDescriptions.Add(new SortDescription("Percentage", ListSortDirection.Ascending));
The collection seems to be updating and reaching the UI; however, every so often I get empty cells in the RadListBox after a sorting happens.
If I scroll away and come back the area is filled in. Is there something I can do manually so that this area is filled in? Should I try reloading something in some way?
I've tried invalidating things in the wrap panel but this hasn't worked:
wrapPanel?.InvalidateArrange(); wrapPanel?.InvalidateMeasure(); wrapPanel?.InvalidateVisual(); wrapPanel?.UpdateLayout();
Any help or suggestions are appreciated
Hi Giuliano,
I have tested this but it seems to work on my side. I have attached my test project. Could you please check it and let me know what I need to change to reproduce this?
I am looking forward to your reply.
I was able to replicate the issue with a few changes. I made changes so that the collection is constantly updating that way it needs to be sorted more than once. I also moved
into the constructor of MyViewModel.
In my application I don't plan on there being a sort button. I thought that binding to ListCollectionView and making IsLiveSorting true would sort the collection without it needing to be prompted. I would be ok with prompting it but on larger collections that require a scroll bar the sort button is sending the scroll bar to the top. Also, I'm using 2023.1.117 as my Telerik version. I'm not sure if the problem persists in newer versions. I've attached the project with the modifications.