RadzenGrid with RadzenTabs expanded inside

Hello,

I have a RadzenGrid with RadzenTabs inside. The grid has more than 7000 rows and the user wants each row to appear expanded.

In the RadzenGrid I have the following code:

RowRender = "@ RowRender" ExpandMode = "DataGridExpandMode.Multiple"

In the code:

protected void RowRender(RowRenderEventArgs<Pro_Proyecto> args)
{
args.Expandable = true;
}

protected override void OnAfterRender(bool firstRender)
{
    if (firstRender)
    {
        foreach (Pro_Proyecto proyecto in proyectos)
        {
            gridListado.ExpandRow(proyecto);
            StateHasChanged();
        }
    }

    base.OnAfterRender(firstRender);
}

The problem is that it takes a long time to load the entire grid with the rows expanded.

Am I doing it wrong, is there any other way to do it?

Thank you very much in advance.

You shouldn't display 7000 expanded rows at the same time.

All 7000 rows are not displayed at once, page size is 10.

<RadzenGrid @ref="gridListado" Data="proyectos" TItem="Pro_Proyecto" AllowPaging="true" PageSize="10" RowRender="@RowRender" ExpandMode="DataGridExpandMode.Multiple">

Could you make only the first 10 records expanded initially, and when changing the page expand another 10 more? How would it be?

Try calling StateHasChanged only once.

protected override void OnAfterRender(bool firstRender)
{
    if (firstRender)
    {
        foreach (Pro_Proyecto proyecto in proyectos)
        {
            gridListado.ExpandRow(proyecto);
        }

        StateHasChanged();
    }

    base.OnAfterRender(firstRender);
}

Also you should be aware that every expanded row needs to populate its contents which may make more DB requests which tends to be slow.

Works!

Thank you very much.