Using VirtualQueryableCollectionView with an itemscontrol

17 posts, 0 answers
  1. Ganesh Shivshankar
    Ganesh Shivshankar avatar
    78 posts
    Member since:
    Sep 2009

    Posted 04 May 2011 Link to this post

    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
  2. Vlad
    Admin
    Vlad avatar
    11100 posts

    Posted 04 May 2011 Link to this post

    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
  3. DevCraft banner
  4. Ganesh Shivshankar
    Ganesh Shivshankar avatar
    78 posts
    Member since:
    Sep 2009

    Posted 04 May 2011 Link to this post

    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
  5. Vlad
    Admin
    Vlad avatar
    11100 posts

    Posted 04 May 2011 Link to this post

    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
  6. Ganesh Shivshankar
    Ganesh Shivshankar avatar
    78 posts
    Member since:
    Sep 2009

    Posted 04 May 2011 Link to this post

    Hi Vlad,

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

    Cheers,
    Ganesh
  7. Vlad
    Admin
    Vlad avatar
    11100 posts

    Posted 04 May 2011 Link to this post

    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
  8. Ganesh Shivshankar
    Ganesh Shivshankar avatar
    78 posts
    Member since:
    Sep 2009

    Posted 04 May 2011 Link to this post

    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
  9. Ganesh Shivshankar
    Ganesh Shivshankar avatar
    78 posts
    Member since:
    Sep 2009

    Posted 09 May 2011 Link to this post

    Any help on this will be much appreciated.

    Thanks.
  10. Vlad
    Admin
    Vlad avatar
    11100 posts

    Posted 12 May 2011 Link to this post

    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
  11. Ganesh Shivshankar
    Ganesh Shivshankar avatar
    78 posts
    Member since:
    Sep 2009

    Posted 25 Sep 2012 Link to this post

    Hi Vlad,

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

    Thanks.

    Ganesh
  12. Vlad
    Admin
    Vlad avatar
    11100 posts

    Posted 25 Sep 2012 Link to this post

    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.

  13. Ganesh Shivshankar
    Ganesh Shivshankar avatar
    78 posts
    Member since:
    Sep 2009

    Posted 25 Sep 2012 Link to this post

    Hi Vlad,

    That works perfectly!

  14. Ganesh Shivshankar
    Ganesh Shivshankar avatar
    78 posts
    Member since:
    Sep 2009

    Posted 25 Sep 2012 Link to this post

    Hi Vlad,

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

    Thanks.
  15. Vlad
    Admin
    Vlad avatar
    11100 posts

    Posted 25 Sep 2012 Link to this post

    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.

  16. Ganesh Shivshankar
    Ganesh Shivshankar avatar
    78 posts
    Member since:
    Sep 2009

    Posted 25 Sep 2012 Link to this post

    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?
  17. Vlad
    Admin
    Vlad avatar
    11100 posts

    Posted 25 Sep 2012 Link to this post

    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.

  18. Ganesh Shivshankar
    Ganesh Shivshankar avatar
    78 posts
    Member since:
    Sep 2009

    Posted 25 Sep 2012 Link to this post

    Thanks for all your patient answers Vlad! Much appreciated!
Back to Top
DevCraft banner