# .NET MAUI DataPager Data Source Binding

The Telerik UI for .NET MAUI DataPager can page any collection that implements the `IEnumerable` interface.

To bind the desired collection to the DataPager, pass the collection to the DataPager's `Source` (`object`) property.  This will split the data into pages.

The following demonstrates how to use the `Source` property to bind a collection:

**1.** Define the DataPager in XAML:

```XAML
<telerik:RadDataPager x:Name="dataPager" Source="{Binding Data}" />
```

**2.** Add a sample `ViewModel`:

```C#
public class ViewModel
{
    public ViewModel()
    {
        Data = CreateData(200);
    }

    public List<int> Data { get; set; }

    internal static List<int> CreateData(int count)
    {
        List<int> source = new List<int>();

        for (int i = 0; i < count; i++)
        {
            source.Add(i);
        }

        return source;
    }
}
```

**3.** Set the `ViewModel` as a `BindingContext`:

```C#
this.BindingContext = new ViewModel();
```

## Binding to the PagedSource Property of the RadDataPager

Often, your collection will be a simple `List`, an `ObservableCollection`, or a collection that inherits from `IEnumerable`. 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. In these scenarios, bind to the `PagedSource` (`IEnumerable`) property of the `RadDataPager`.

![DataPager PagedSource](https://www.telerik.com/maui-ui/documentation/assets/4de4c72c9aab81c67a3ca4cc965ee794/datapager-databinding.png)

The image above illustrates the process for binding to the `PagedSource` property of the DataPager:

1. You assign an `object` to the `Source` of a `RadDataPager`.
2. The `RadDataPager` wraps the `Source` in a custom collection.
3. The `Source` is exposed through the `RadDataPager.PagedSource` property.
4. Attach an item control to the `PagedSource` property and the control will be paged automatically.

Review the [Integration with DataGrid](https://www.telerik.com/maui-ui/documentation/controls/datapager/integration/datagrid) and [Integration with CollectionView](https://www.telerik.com/maui-ui/documentation/controls/datapager/integration/collectionview) articles, for more details how to use the `PagedSource` property.

## See Also

* [Display Modes](https://www.telerik.com/maui-ui/documentation/controls/datapager/display-mode)
* [Ellipsis Modes](https://www.telerik.com/maui-ui/documentation/controls/datapager/ellipsis-mode)
* [Page Configuration](https://www.telerik.com/maui-ui/documentation/controls/datapager/page-configuration)
* [Localization](https://www.telerik.com/maui-ui/documentation/controls/datapager/localization)
* [Commands in DataPager](https://www.telerik.com/maui-ui/documentation/controls/datapager/commands)
* [Styling](https://www.telerik.com/maui-ui/documentation/controls/datapager/styling/datapager)
* [Integration with DataGrid](https://www.telerik.com/maui-ui/documentation/controls/datapager/integration/datagrid)
