Hierarchy Doubt

Hello, good morning.
Once again I would like to congratulate you for your great work and I would like to take this opportunity to congratulate you for the holidays.
On the other hand, I wanted to ask you about Hierarchy... I'm trying to implement it and I don't see what could be the bug.

I have this code on the page:

An this other in C#

    DataGridExpandMode expandMode = DataGridExpandMode.Single;
    void OnDeliveryDataGridRender(DataGridRenderEventArgs<CropuServerWeb.Models.APT.LmsMsDeliveryNote> args)
    {
        if (args.FirstRender)
        {
            InvokeAsync(() => args.Grid.ExpandRow(args.Grid.View.Where(c => c.IC_LmsMsDeliveryNote_Details.Any()).FirstOrDefault()));
        }
    }

    async void RowRender(RowRenderEventArgs<CropuServerWeb.Models.APT.LmsMsDeliveryNote> args)
    {   
        args.Expandable = args.Data.IC_LmsMsDeliveryNote_Details.Any();
    }

But the erro that i get is:

IC_LmsMsDeliveryNote_Details es un ICollection is implemented in public partial class LmsMsDeliveryNote

I don't know what to try to make it work, can you think of anything?
Thank you very much for everything and Merry Christmas.

Accordion to the exception this is null. You need to extend your check like this:

        args.Expandable = args.Data.IC_LmsMsDeliveryNote_Details?.Any() == true;

Great! thanks for your response.