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?
<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>
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