This is a migrated thread and some comments may be shown as answers.

Using VirtualQueryableCollectionView with an itemscontrol

16 Answers 160 Views
Data Virtualization
This is a migrated thread and some comments may be shown as answers.
Ganesh Shivshankar
Top achievements
Rank 1
Ganesh Shivshankar asked on 04 May 2011, 07:45 AM
Hi,

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

Sort by
0
Vlad
Telerik team
answered on 04 May 2011, 08:03 AM
Hi,

 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
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
0
Ganesh Shivshankar
Top achievements
Rank 1
answered on 04 May 2011, 08:33 AM
Hi Vlad,

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
0
Vlad
Telerik team
answered on 04 May 2011, 08:49 AM
Hi Ganesh,

 I'm afraid that RadUniformGrid is not VirtualizingPanel - the virtual collection can work only with virtualized controls. 

Regards,
Vlad
the Telerik team
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
0
Ganesh Shivshankar
Top achievements
Rank 1
answered on 04 May 2011, 08:51 AM
Hi Vlad,

Thanks. Is it possible to extend the RadUniformGrid and virtualization to it?

Cheers,
Ganesh
0
Vlad
Telerik team
answered on 04 May 2011, 09:00 AM
Hi,

 Currently we do not have such plans.

Best wishes,
Vlad
the Telerik team
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
0
Ganesh Shivshankar
Top achievements
Rank 1
answered on 04 May 2011, 10:33 AM
Thanks.

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
0
Ganesh Shivshankar
Top achievements
Rank 1
answered on 09 May 2011, 05:14 AM
Any help on this will be much appreciated.

Thanks.
0
Vlad
Telerik team
answered on 12 May 2011, 06:48 AM
Hi,

 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
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
0
Ganesh Shivshankar
Top achievements
Rank 1
answered on 25 Sep 2012, 08:12 AM
Hi Vlad,

Is this now possible with ItemsControl and RadUniformGrid? I'm now versio 2012.1.326.

Thanks.

Ganesh
0
Vlad
Telerik team
answered on 25 Sep 2012, 08:19 AM
Hi 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.

0
Ganesh Shivshankar
Top achievements
Rank 1
answered on 25 Sep 2012, 08:51 AM
Hi Vlad,

That works perfectly!

0
Ganesh Shivshankar
Top achievements
Rank 1
answered on 25 Sep 2012, 09:46 AM
Hi Vlad,

One more question. Can we show a intermediate loading template on items while the collection is being loaded?

Thanks.
0
Vlad
Telerik team
answered on 25 Sep 2012, 10:33 AM
Hello,

 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.

0
Ganesh Shivshankar
Top achievements
Rank 1
answered on 25 Sep 2012, 10:38 AM
Great, thanks Vlad!

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?
0
Vlad
Telerik team
answered on 25 Sep 2012, 10:42 AM
Hi,

 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.

0
Ganesh Shivshankar
Top achievements
Rank 1
answered on 25 Sep 2012, 10:48 AM
Thanks for all your patient answers Vlad! Much appreciated!
Tags
Data Virtualization
Asked by
Ganesh Shivshankar
Top achievements
Rank 1
Answers by
Vlad
Telerik team
Ganesh Shivshankar
Top achievements
Rank 1
Share this question
or