# Hierarchy DataGrid not Expanding Rows

**URL:** <https://forum.radzen.com/t/hierarchy-datagrid-not-expanding-rows/19255>\
**Category:** Radzen.Blazor Components\
**Created:** [December 11, 2024, 12:20pm UTC](https://forum.radzen.com/t/hierarchy-datagrid-not-expanding-rows/19255 "2024-12-11T12:20:58Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Pedro\_Horta](https://forum.radzen.com/user_avatar/forum.radzen.com/pedro_horta/32/17961_2.png) [@Pedro\_Horta](https://forum.radzen.com/u/Pedro_Horta)\
**Post date:** [December 11, 2024, 12:20pm UTC](https://forum.radzen.com/t/hierarchy-datagrid-not-expanding-rows/19255/1 "2024-12-11T12:20:58Z")

</div>

Greetings,  
I'm facing an issue with an Hierarchy DataGrid not showing "subrecords"  
I'm can't seem to realize what I'm doing wrong, since I already have the "subrecord" data "ready to display"

```auto
<RadzenDataGrid @ref="modulesGrid"
    TItem="AuthorizationProfileModel"
    AllowFiltering="true"
    AllowSorting="true"
    Data="@modulesList"
    RowRender="@RowRender"
    RowClick="OnRowClick"
    RowSelect="OnRowSelect"
    LoadChildData="LoadChildData"
    RowCollapse="@(args => modulesGrid.ColumnsCollection.ToList().ForEach(c => c.ClearFilters()))">
            <Columns>
            <RadzenDataGridColumn Frozen="true" Sortable="false" Filterable="false" Width="300px">
                <Template Context="data">
                        @data.ModuleName
                </Template>
            </RadzenDataGridColumn>
        </Column>
</RadzenDataGrid>

```

```auto
async void RowRender(RowRenderEventArgs<AuthorizationProfileModel> args)
{
    args.Expandable = (await AuthorizationProfilesFactory.GetLoginPermissions(dbAccess, selectedUser, $"{args.Data.Module}_1")).ToList().Any();
    //args.Expandable = modulesList.Any() ;
}

async void LoadChildData(DataGridLoadChildDataEventArgs<AuthorizationProfileModel> args)
{
    try
    {
        args.Data = await AuthorizationProfilesFactory.GetLoginPermissions(dbAccess, selectedUser, $"{args.Item.Module}_1");
        //await modulesGrid.ExpandRow(args.Item);
    }
    catch (Exception ex)
    {
        NotificationService.Notify(new NotificationMessage
            {
                Severity = NotificationSeverity.Error,
                Summary = "Erro: ",
                Detail = ex.Message,
                Duration = 5000
            });
    }
}

```

Best Regards,

---

<div class="post-metadata">

**Author:** ![enchev](https://forum.radzen.com/user_avatar/forum.radzen.com/enchev/32/16_2.png) [@enchev](https://forum.radzen.com/u/enchev)\
**Post date:** [December 12, 2024, 6:59am UTC](https://forum.radzen.com/t/hierarchy-datagrid-not-expanding-rows/19255/2 "2024-12-12T06:59:42Z")

</div>

> [@Pedro\_Horta](#):
>
> `async void`

Async voids are not recommended:

> **[Async/Await - Best Practices in Asynchronous Programming](https://learn.microsoft.com/en-us/archive/msdn-magazine/2013/march/async-await-best-practices-in-asynchronous-programming#avoid-async-void)**

Use async Task instead:

> [@RadzenDataGrid self-Reference hierarchy not working with await](http://forum.radzen.com/t/radzendatagrid-self-reference-hierarchy-not-working-with-await/18149):
>
> RadzenDataGrid is not displaying children if I use await in OnLoadChildData event like this: async 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 = fal…

---

<div class="post-metadata">

**Author:** ![Pedro\_Horta](https://forum.radzen.com/user_avatar/forum.radzen.com/pedro_horta/32/17961_2.png) [@Pedro\_Horta](https://forum.radzen.com/u/Pedro_Horta)\
**Post date:** [December 12, 2024, 10:13am UTC](https://forum.radzen.com/t/hierarchy-datagrid-not-expanding-rows/19255/3 "2024-12-12T10:13:35Z")

</div>

Thank you very much for your help, I didn't realise that  
Regards
