Radzen Blazor Components

DataGrid LoadData

The LoadData event allows you to perform custom paging, sorting and filtering.

ID
Photo
First Namefilter_alt
Last Namefilter_alt
Job Titlefilter_alt
Titlefilter_alt
Birth Datefilter_alt
Hire Datefilter_alt
Addressfilter_alt
Cityfilter_alt
Regionfilter_alt
Postal Codefilter_alt
Countryfilter_alt
Home Phonefilter_alt
Extensionfilter_alt
Notesfilter_alt

Perform custom data-binding

1. Set the Data and Count properties.

<RadzenDataGrid Count="@count" Data="@employees"

2. Handle the LoadData event and update the Data and Count backing fields (employees and count in this case).


void LoadData(LoadDataArgs args)
{
    var query = dbContext.Employees.AsQueryable();

    if (!string.IsNullOrEmpty(args.Filter))
    {
        query = query.Where(args.Filter);
    }

    if (!string.IsNullOrEmpty(args.OrderBy))
    {
        query = query.OrderBy(args.OrderBy);
    }

    count = query.Count();

    employees = query.Skip(args.Skip.Value).Take(args.Top.Value).ToList();


} 
            

Supercharge your Blazor development with Radzen Blazor Studio

Radzen Blazor Studio is a software development environment that empowers developers to design, build and deploy Blazor applications without the traditional hurdles. Write less code and get more done.

open_in_new Learn More
>Radzen Blazor Studio

Radzen Blazor Components, © 2018-2024 Radzen.
Source Code licensed under MIT

Demos Configuration

Premium Themes

  • Material 3
  • Fluent
  • Material 3 Dark
  • Material Dark
  • Fluent Dark

Free Themes

  • Material
  • Standard
  • Default
  • Humanistic
  • Software
  • Dark
An error has occurred. This app may no longer respond until reloaded. Reload 🗙