How easy/difficult is it to try and use the VirtualQueryableCollectionView with an itemscontrol with scrolling? Has anyone tried to attempt this? If yes can I get some guidance?
Thanks.
Ganesh
16 Answers, 1 is accepted
Very easy if your items control is virtualized. For example ListBox is exactly such ItemsControl - you can check the attached example application with ListBox bound to virtual collection of 1 million items.
Kind regards,Vlad
the Telerik team
Thanks for the very quick response. However if I try to put the RadUniformGrid in the Listbox ItemsPanel the app just hangs. Just put this in the MainPage.xaml in the same you attached
<
ListBox
ItemsSource
=
"{Binding}"
>
<
ListBox.ItemTemplate
>
<
DataTemplate
>
<
TextBlock
Text
=
"{Binding ID}"
/>
</
DataTemplate
>
</
ListBox.ItemTemplate
>
<
ListBox.ItemsPanel
>
<
ItemsPanelTemplate
>
<
Primitives:RadUniformGrid
Columns
=
"2"
ChildrenFlow
=
"Horizontal"
VerticalAlignment
=
"Top"
/>
</
ItemsPanelTemplate
>
</
ListBox.ItemsPanel
>
</
ListBox
>
Thanks.
Ganesh
I'm afraid that RadUniformGrid is not VirtualizingPanel - the virtual collection can work only with virtualized controls.
Regards,Vlad
the Telerik team
Thanks. Is it possible to extend the RadUniformGrid and virtualization to it?
Cheers,
Ganesh
Currently we do not have such plans.
Best wishes,Vlad
the Telerik team
In the sample project try and use this instead of ListBox
<
ItemsControl
ItemsSource
=
"{Binding}"
>
<
ItemsControl.ItemTemplate
>
<
DataTemplate
>
<
TextBlock
Text
=
"{Binding ID}"
/>
</
DataTemplate
>
</
ItemsControl.ItemTemplate
>
<
ItemsControl.ItemsPanel
>
<
ItemsPanelTemplate
>
<
VirtualizingStackPanel
/>
</
ItemsPanelTemplate
>
</
ItemsControl.ItemsPanel
>
</
ItemsControl
>
Doesnt work either.
Cheers,
Ganesh
Thanks.
I'm afraid that simply changing ItemsPanel of plain ItemsControl to VirtualizingStackPanel will not make it virtual. You will need ScrollViewer as well.
Regards,Vlad
the Telerik team
Is this now possible with ItemsControl and RadUniformGrid? I'm now versio 2012.1.326.
Thanks.
Ganesh
RadUniformGrid is not a virtual panel/grid - you can use our VirtualizingWrapPanel instead.
Greetings,Vlad
the Telerik team
Time to cast your vote for Telerik! Tell DevPro Connections and Windows IT Pro why Telerik is your choice. Telerik is nominated in a total of 25 categories.
That works perfectly!
One more question. Can we show a intermediate loading template on items while the collection is being loaded?
Thanks.
I've attached an example project to illustrate you how to achieve your goal.
Regards,Vlad
the Telerik team
Time to cast your vote for Telerik! Tell DevPro Connections and Windows IT Pro why Telerik is your choice. Telerik is nominated in a total of 25 categories.
One last question though :). When I have say 5000 total results with 20 per page and I scroll right to the bottom it makes a whole load of requests to the server to get the records for all the intermediate pages. How do we avoid that? Is it possible?
I believe you can call less times your service if you use for example some timer and raise the call after some time (for example 200 milliseconds) in ItemsLoading event of the virtual collection.
All the best,Vlad
the Telerik team
Time to cast your vote for Telerik! Tell DevPro Connections and Windows IT Pro why Telerik is your choice. Telerik is nominated in a total of 25 categories.