New to Telerik UI for .NET MAUI? Start a free 30-day trial

.NET MAUI DataGrid LoadOnDemand Collection

Updated on Sep 28, 2026

To load data on demand by using a collection, feed the RadDataGrid with a collection of type Telerik.Maui.LoadOnDemandCollection. The LoadOnDemandCollection is a generic type, so you need to specify the type of objects it will contain. The type extends the ObservableCollection<T> class and expects a Func<CancellationToken, IEnumerable> in the constructor.

Example

The following example demonstrates a sample setup that shows how to use the collection:

  1. Define the DataGrid in XAML:
XAML
<telerik:RadDataGrid x:Name="dataGrid"
                     ItemsSource="{Binding Items}"
                     LoadOnDemandMode="{Binding LoadOnDemandMode}"
                     LoadOnDemandBufferItemsCount="{Binding Source={x:Reference slider}, Path=Value}"/>
  1. Add the telerik namespace:
xaml
xmlns:telerik="http://schemas.telerik.com/2022/xaml/maui"
  1. Add sample data:
C#
public class Person
{
    public string Name { get; set; }
    public int Age { get; set; }
    public Gender Gender { get; set; }
}
  1. Declare the Items property:
C#
this.Items = new LoadOnDemandCollection<Person>((cancelationToken) =>
{
    var list = new List<Person>();
    for (int i = 0; i < 10; i++)
    {
        var person = new Person { Name = "LOD Person " + i, Age = i + 18, Gender = i % 2 == 0 ? Gender.Male : Gender.Female };
        list.Add(person);
    }

    return list;
});
  1. Set data to the Items collection:
C#
this.Items = new LoadOnDemandCollection<Person>((cancelationToken) =>
{
    var list = new List<Person>();
    for (int i = 0; i < 10; i++)
    {
        var person = new Person { Name = "LOD Person " + i, Age = i + 18, Gender = i % 2 == 0 ? Gender.Male : Gender.Female };
        list.Add(person);
    }

    return list;
});

For DataGrid LoadOnDemandCollection example, refer to the SDKBrowser Demo application and go to the DataGrid > LoadOnDemand category.

See Also

In this article
ExampleSee Also
Not finding the help you need?
Contact Support