DataGridRow closes with async RowExpand callback #650

Closed
opened 2026-01-29 17:40:56 +00:00 by claunia · 4 comments
Owner

Originally created by @buehler on GitHub (Nov 28, 2022).

Describe the bug
After expending a radzen grid row with an async RowExpand callback, the row immediately closes again.

To Reproduce
Steps to reproduce the behavior:

  1. Create a RadzenGrid analog to the example in https://blazor.radzen.com/master-detail-hierarchy-demand
  2. Make the RowExpand callback async and make two awaited calls in it
  3. Expand the row in the UI
  4. The row will open and immediately close again

Expected behavior
It would be nice to have the row to stay open.

Screenshots
If applicable, add screenshots to help explain your problem.

Desktop (please complete the following information):

  • OS: Windows 11
  • Browser: newest Chrome

Additional context
I also tried with "StateHasChanged" at the end of the async method. Sadly, it just closes.

Originally created by @buehler on GitHub (Nov 28, 2022). **Describe the bug** After expending a radzen grid row with an async RowExpand callback, the row immediately closes again. **To Reproduce** Steps to reproduce the behavior: 1. Create a RadzenGrid analog to the example in https://blazor.radzen.com/master-detail-hierarchy-demand 2. Make the RowExpand callback async and make two awaited calls in it 3. Expand the row in the UI 4. The row will open and immediately close again **Expected behavior** It would be nice to have the row to stay open. **Screenshots** If applicable, add screenshots to help explain your problem. **Desktop (please complete the following information):** - OS: Windows 11 - Browser: newest Chrome **Additional context** I also tried with "StateHasChanged" at the end of the async method. Sadly, it just closes.
Author
Owner

@buehler commented on GitHub (Nov 28, 2022):

I have an addition: When the object reference does not change, the row does not close. So using myObject.Prop ??= ... results in a closing row.

@buehler commented on GitHub (Nov 28, 2022): I have an addition: When the object reference does not change, the row does not close. So using `myObject.Prop ??= ...` results in a closing row.
Author
Owner

@buehler commented on GitHub (Nov 28, 2022):

When using the same object, it works:

private async Task RowExpand(User user)
{
    user.Details.Roles = (await RoleService.GetUserRoles(user.Id)).ToList();
    user.Details.Redemptions = await Tokens.GetRedeemedUserTokens(user.Id);
}

Should this stay open, i.e. is it still a bug?

@buehler commented on GitHub (Nov 28, 2022): When using the same object, it works: ```csharp private async Task RowExpand(User user) { user.Details.Roles = (await RoleService.GetUserRoles(user.Id)).ToList(); user.Details.Redemptions = await Tokens.GetRedeemedUserTokens(user.Id); } ``` Should this stay open, i.e. is it still a bug?
Author
Owner

@enchev commented on GitHub (Nov 28, 2022):

Hi @buehler,

Unfortunately no row state can be preserved if the data item is different every time.

@enchev commented on GitHub (Nov 28, 2022): Hi @buehler, Unfortunately no row state can be preserved if the data item is different every time.
Author
Owner

@buehler commented on GitHub (Nov 28, 2022):

Got it, thank you :-)

@buehler commented on GitHub (Nov 28, 2022): Got it, thank you :-)
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/radzen-blazor#650