New to Telerik UI for .NET MAUI? Start a free 30-day trial
.NET MAUI DataGrid LoadOnDemand Event
Updated on Sep 28, 2026
You can load new items in the DataGrid by using the LoadOnDemand event. The LoadOnDemand event handler receives the following parameters:
- The
senderargument, which is of typeobject, but can be cast to theRadDataGridtype. - A
LoadOnDemandEventArgsobject, which provides theIsDataLoaded(bool) property, indicating whether the data is loaded.
Example
The following example demonstrates a sample setup that shows how to use the event:
- Define the DataGrid in XAML:
XAML
<telerik:RadDataGrid x:Name="dataGrid"
ItemsSource="{Binding Items}"
LoadOnDemand="dataGrid_LoadOnDemand"
LoadOnDemandMode="Automatic"
LoadOnDemandBufferItemsCount="{Binding Source={x:Reference slider}, Path=Value}"/>
- Add the telerik namespace:
xaml
xmlns:telerik="http://schemas.telerik.com/2022/xaml/maui"
- Add sample data:
C#
public class Person
{
public string Name { get; set; }
public int Age { get; set; }
public Gender Gender { get; set; }
}
- Define the
ViewModel:
C#
public class LoadOnDemandEventViewModel
{
public LoadOnDemandEventViewModel()
{
this.Items = new ObservableCollection<Person>();
for (int i = 0; i < 20; i++)
{
var person = new Person { Name = "Person " + i, Age = i + 18, Gender = i % 2 == 0 ? Gender.Male : Gender.Female };
this.Items.Add(person);
}
}
public ObservableCollection<Person> Items { get; set; }
}
- Handle the
LoadOnDemandevent:
C#
private void dataGrid_LoadOnDemand(object sender, Telerik.Maui.Controls.DataGrid.LoadOnDemandEventArgs e)
{
for (int i = 0; i < 15; i++)
{
((sender as RadDataGrid).ItemsSource as ObservableCollection<Person>).Add(new Person() { Name = "Person " + i, Age = i + 18, Gender = i % 2 == 0 ? Gender.Male : Gender.Female });
}
e.IsDataLoaded = true;
}
For DataGrid LoadOnDemand event example, refer to the SDKBrowser Demo application and go to the DataGrid > LoadOnDemand category.