# Source and Paged Source

The one most important property of the **RadDataPager** is its **Source** property. This is where you pass in your collection of data for paging.

More often your collection **will not be** an [IPagedCollectionView](http://msdn.microsoft.com/en-us/library/system.componentmodel.ipagedcollectionview%28VS.95%29.aspx). It will either be a simple [List<T>](http://msdn.microsoft.com/en-us/library/6sh2ey19.aspx), or an [ObservableCollection<T>](http://msdn.microsoft.com/en-us/library/ms668604.aspx), or anything that is simply an [IEnumerable](http://msdn.microsoft.com/en-us/library/system.collections.ienumerable.aspx). Unless you had paging in mind when you designed your project, it is almost certain that your data source will not be pageable out of the box. From here on you have two options:

* [Wrap your collection in an ***IPagedCollectionView*** / ***QueryableCollectionView***](https://www.telerik.com/products/wpf/documentation/controls/raddatapager/features/source-and-paged-source#wrapping-a-collection-in-an-ipagedcollectionview-queryablecollectionview)

* [Bind to the **PagedSource** property of the **RadDataPager**](https://www.telerik.com/products/wpf/documentation/controls/raddatapager/features/source-and-paged-source#binding-to-the-PagedSource-property-of-the-raddatapager)

## Wrapping a collection in an IPagedCollectionView/QueryableCollectionView

![WPF RadDataPager IPagedCollectionView](https://www.telerik.com/products/wpf/documentation/assets/7673e7204899dfa087c6df314ba8ceb9/raddatapager_features_sourceandpagedsource_01.png)

If you look at the constructors of [PagedCollectionView](http://msdn.microsoft.com/en-us/library/system.windows.data.pagedcollectionview%28VS.95%29.aspx) and [QueryableCollectionView](http://www.telerik.com/help/wpf/t_telerik_windows_data_queryablecollectionview.html) you will notice that you can pass in a simple [IEnumerable](http://msdn.microsoft.com/en-us/library/system.collections.ienumerable.aspx) as a parameter. Those two classes will wrap it and provide paging capabilities over your original data.

Imagine that you have a simple [IEnumerable](http://msdn.microsoft.com/en-us/library/system.collections.ienumerable.aspx) which is the source for an [ItemsControl](http://msdn.microsoft.com/en-us/library/system.windows.controls.itemscontrol.aspx). Here is shown how to wrap it in order to enable paging with **RadDataPager**.

```C#
IEnumerable itemsSource = Enumerable.Range(0, 1000);
var pagedSource = new PagedCollectionView(itemsSource);
this.radDataPager.Source = pagedSource;
this.itemsControl.ItemsSource = pagedSource;
```

```VB.NET

Dim itemsSource As IEnumerable = Enumerable.Range(0, 1000)
Dim pagedSource = New PagedCollectionView(itemsSource)
Me.radDataPager.Source = pagedSource
Me.itemsControl.ItemsSource = pagedSource
```

```C#
IEnumerable itemsSource = Enumerable.Range(0, 1000);
var pagedSource = new QueryableCollectionView(itemsSource);
this.radDataPager.Source = pagedSource;
this.itemsControl.ItemsSource = pagedSource;
```

```VB.NET
Dim itemsSource As IEnumerable = Enumerable.Range(0, 1000)
Dim pagedSource = New QueryableCollectionView(itemsSource)
Me.radDataPager.Source = pagedSource
Me.itemsControl.ItemsSource = pagedSource
```

> The **QueryableCollectionView** class is defined in the **Telerik.Windows.Data** namespace so make sure to include it in your page (via the **Using** or **Import** statements).

```XAML
<ListBox Name="itemsControl"/>
<telerikGrid:RadDataPager Name="radDataPager" PageSize="10" DisplayMode="All"/>
```

## Binding to the PagedSource property of the RadDataPager

![WPF RadDataPager Binding to the PagedSource](https://www.telerik.com/products/wpf/documentation/assets/d43bdb1b2394b8cccb969a0a157d6daa/raddatapager_features_sourceandpagedsource_02.png)

In case you do not like the first approach there is a better one. When you assign an [IEnumerable](http://msdn.microsoft.com/en-us/library/system.collections.ienumerable.aspx) as the **Source** of a [RadDataPager](https://www.telerik.com/products/wpf/documentation/controls/radgridview/paging/using-telerik-raddatapager) it will automatically wrap it in a [QueryableCollectionView](https://www.telerik.com/products/wpf/documentation/common-information/consuming-data/queryablecollectionview) and expose it through its **PagedSource** property. From then on, you can attach any number of **ItemsControls** to the **PagedSource** and they will be automatically paged. Here is how to do this entirely in XAML.

```XAML
<ListBox Name="itemsControl2"
         ItemsSource="{Binding PagedSource, ElementName=radDataPager}"/>
<telerikGrid:RadDataPager Name="radDataPager2"
               Source="{Binding myItemsSource}"
               PageSize="10"
               DisplayMode="All"/>
```

## See Also

* [Infinite Paging](https://www.telerik.com/products/wpf/documentation/controls/raddatapager/features/infinite-paging)
* [Unbound Mode](https://www.telerik.com/products/wpf/documentation/controls/raddatapager/features/unbound-mode)
