# DataGrid self-Reference hierarchy not showing "Childs"

**URL:** <https://forum.radzen.com/t/datagrid-self-reference-hierarchy-not-showing-childs/19507>\
**Category:** Radzen.Blazor Components\
**Created:** [January 10, 2025, 5:53pm UTC](https://forum.radzen.com/t/datagrid-self-reference-hierarchy-not-showing-childs/19507 "2025-01-10T17:53:26Z")\
**Posts on this page:** 5\
**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:** [January 10, 2025, 5:53pm UTC](https://forum.radzen.com/t/datagrid-self-reference-hierarchy-not-showing-childs/19507/1 "2025-01-10T17:53:26Z")

</div>

Greetings,  
I'm facing a problem using DataGrid self-Reference hierarchy

The issue is that the "Parents" are correctly shown, but the "Childs" are not displayed even though args.Data has the correct data.

Am I doing something wrong?

```auto
<RadzenDataGrid @ref="modulesGrid"
                Data="@modulesList"
                RowRender="@RowRender"
                LoadChildData="LoadChildData"
                TItem="AuthorizationProfileModel"
                RowCollapse="@(args => modulesGrid.ColumnsCollection.ToList().ForEach(c => c.ClearFilters()))">
    <Columns>
        <RadzenDataGridColumn Width="300px">
            <Template Context="data">
                @data.ModuleName
            </Template>
        </RadzenDataGridColumn>
    </Columns>
</RadzenDataGrid>

```

```auto
IEnumerable<AuthorizationProfileModel>? modulesList;
RadzenDataGrid<AuthorizationProfileModel> modulesGrid;

*filling moduleslist*

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

 async void LoadChildData(DataGridLoadChildDataEventArgs<AuthorizationProfileModel> args)
 {
     args.Data = await AuthorizationProfilesFactory.GetLoginPermissions(dbAccess, selectedUser.LoginEmail, $"{args.Item.Module}_1");
}

```

Best Regards,  
PH

---

<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:** [January 13, 2025, 5:30am UTC](https://forum.radzen.com/t/datagrid-self-reference-hierarchy-not-showing-childs/19507/2 "2025-01-13T05:30:13Z")

</div>

Please post runnable code where we can replicate the problem - use our demos, they are editable.

---

<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:** [January 13, 2025, 10:48am UTC](https://forum.radzen.com/t/datagrid-self-reference-hierarchy-not-showing-childs/19507/3 "2025-01-13T10:48:51Z")

</div>

Hello again,  
Here you have some runable code I tried to make it as minimal as I could, this will run in the Radzen Demos, my issue is that even if the args.Data has Data (as shown in the screenshot below) it never shows it  
The result I get is as if I commented

```auto
  //args.Data = dbContext.Employees.Where(e => e.ReportsTo == args.Item.EmployeeID);

```

 ![args.Data](https://forum.radzen.com/uploads/default/original/3X/3/c/3c21e0d5ab8de2b5061f43fb66dc0f99ee04c72c.png)

```auto
@using RadzenBlazorDemos.Data
@using RadzenBlazorDemos.Models.Northwind
@using Microsoft.EntityFrameworkCore

@inherits DbContextPage

<RadzenDataGrid @ref="grid" 
                Data="@employees" 
                LoadChildData="@LoadChildData" 
                TItem="Employee">
    <Columns>
        <RadzenDataGridColumn Width="300px">
            <Template Context="data">
                <strong>@data.TitleOfCourtesy @data.FirstName @data.LastName</strong>
            </Template>
        </RadzenDataGridColumn>
    </Columns>
</RadzenDataGrid>

@code {
    IEnumerable<Employee> employees;
    RadzenDataGrid<Employee> grid;

    protected override async Task OnInitializedAsync()
    {
        await base.OnInitializedAsync();
        employees = dbContext.Employees.Where(e => e.ReportsTo == null);
    }
  
    void LoadChildData(DataGridLoadChildDataEventArgs<Employee> args)
    {
        args.Data = dbContext.Employees.Where(e => e.ReportsTo == args.Item.EmployeeID);
    }
}

```

Thank you for your help  
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:** [January 13, 2025, 1:52pm UTC](https://forum.radzen.com/t/datagrid-self-reference-hierarchy-not-showing-childs/19507/4 "2025-01-13T13:52:35Z")

</div>

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

Most probably this is causing the problem - use async Task instead.

---

<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:** [January 13, 2025, 3:34pm UTC](https://forum.radzen.com/t/datagrid-self-reference-hierarchy-not-showing-childs/19507/5 "2025-01-13T15:34:28Z")

</div>

That was indeed the issue  
Thank you for your help 🙂
