locked
GridView and increamental loading RRS feed

  • Question

  • I checked the "XAML data binding sample" for Windows 8  (here is the link for Windows 8.1: http://code.msdn.microsoft.com/windowsapps/Data-Binding-7b1d67b5 ), but have a few questions:

     

    How to trigger the incremental loading? In the sample, have to click the reset button to reload, should it be auto-load when scrolling data to the edge?

    Also in this sample, it calls employeesCVS.Source=employees whenever the data is reloaded. Shouldn't be just define  employeesCVS.Source=employees  once and employeesCVS will be updated whenever new data loaded?

    Thanks.

     

    Monday, August 12, 2013 3:21 AM

Answers

All replies

  • it should load when coming close to the edge but depends what kind of ItemPanel your using

    Microsoft Certified Solutions Developer - Windows Store Apps Using C#

    Monday, August 12, 2013 8:24 AM
  • I am using:

    <GridView.ItemsPanel>
          <ItemsPanelTemplate>
              <VirtualizingStackPanel Orientation="Horizontal"/>
              </ItemsPanelTemplate>
    </GridView.ItemsPanel>

    What ItemPanel should use if this one doesn't work?

    Thanks.

    Monday, August 12, 2013 4:47 PM
  • Hi,encoderuser

    I think here is an example can answer your question.You can refer to this link below to learn how to set ObservableCollection<T> that implements the ISupportIncremental Loading interface and Load more items on gridview when user scroll end:

    http://mtaulty.com/CommunityServer/blogs/mike_taultys_blog/archive/2012/08/15/from-the-windows-8-camps-gridviews-listviews-and-large-data-sets.aspx

    Best Wishes!

    • Marked as answer by Anne Jing Friday, August 16, 2013 2:14 PM
    Tuesday, August 13, 2013 1:10 PM
  • Just want to add that the "ISupportIncremental" interface is a thing of beauty. Once your datasource implements this interface, several of the WinRT controls just suddenly starts loading data incrementally using appropriate heuristics for the size of the screen to fill it properly.

    /Morten
    twitter: http://www.twitter.com/dotMorten
    blog: http://www.sharpgis.net

    Sunday, August 18, 2013 5:24 AM