Using Listview with SfDataPager in UWP DataPager (SfDataPager)

10 May 20211 minute to read

SfDataPager automatically wraps the collection in PagedCollectionView and exposes to the PagedSource property. You can pass the PagedSource property to bind with any ItemsControl’s ItemsSource property. Here, the PagesSource property is bound to the ListBox.

The following code explains how to use Source and PagedSource property in ListBox.

        <local:ViewModel />
            <RowDefinition Height="300"/>
            <RowDefinition Height="*"/>
        <ListBox ItemsSource="{Binding ElementName=sfDataPager, Path=PagedSource}"/>
        <datapager:SfDataPager x:Name="sfDataPager" 
                                Source="{Binding Orders}" />

The following screenshot displays the output for ListView bound with PagedCollection.