RadzenDataGrid self-Reference hierarchy not working with await #1345

Closed
opened 2026-01-29 17:52:22 +00:00 by claunia · 1 comment
Owner

Originally created by @Abbossbek on GitHub (Aug 13, 2024).

RadzenDataGrid is not displaying children if I use await in OnLoadChildData event like this:

 void LoadChildData(DataGridLoadChildDataEventArgs<Organization> args)
 {
     isBusy = true;
     args.Data = await Api.OrgWithCounts()
     isBusy = false;
     StateHasChanged();
 }

It's working if I call it without await:

 void LoadChildData(DataGridLoadChildDataEventArgs<Organization> args)
 {
     isBusy = true;
     args.Data = Task.Run(() => Api.OrgWithCounts()).Result;
     isBusy = false;
     StateHasChanged();
 }

But it should work with await too.

Desktop:

  • OS: Windows
  • Browser: Edge
  • Version: 5.0.4
Originally created by @Abbossbek on GitHub (Aug 13, 2024). RadzenDataGrid is not displaying children if I use await in OnLoadChildData event like this: ``` void LoadChildData(DataGridLoadChildDataEventArgs<Organization> args) { isBusy = true; args.Data = await Api.OrgWithCounts() isBusy = false; StateHasChanged(); } ``` It's working if I call it without await: ``` void LoadChildData(DataGridLoadChildDataEventArgs<Organization> args) { isBusy = true; args.Data = Task.Run(() => Api.OrgWithCounts()).Result; isBusy = false; StateHasChanged(); } ``` But it should work with await too. **Desktop:** - OS: Windows - Browser: Edge - Version: 5.0.4
Author
Owner

@Abbossbek commented on GitHub (Aug 13, 2024):

I found issue. It's working if I make OnLoadChildData as Task:

async Task LoadChildData(DataGridLoadChildDataEventArgs<Organization> args)
 {
     isBusy = true;
     args.Data = await Api.OrgWithCounts()
     isBusy = false;
     StateHasChanged();
 }
@Abbossbek commented on GitHub (Aug 13, 2024): I found issue. It's working if I make OnLoadChildData as Task: ``` async Task LoadChildData(DataGridLoadChildDataEventArgs<Organization> args) { isBusy = true; args.Data = await Api.OrgWithCounts() isBusy = false; StateHasChanged(); } ```
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/radzen-blazor#1345