Radzen DataGrid: Multiple Access to RenderFragment Columns collection

Hi, all. I'm working on an example that uses a DataGrid component to show some tabular data.
Columns are dynamically generated as in the Components Demo example, via a method like:

void prepareColumnRenderFragment()
{
_columnRenderFragment = ......... // dynamically generated
}

Later in the markup i've some code like:

<RadzenDataGrid @ref="grid" Data="@GetData()" TItem="IDataRow" @bind-Value="selectedRows" RowSelect="RowClicked" SelectionMode="DataGridSelectionMode.Single" FilterMode="FilterMode.Simple" AllowFiltering="true" AllowPaging="true" AllowSorting="true" ColumnWidth="200px">

@GetColumns()

the GetColumns method returns the previously generated render fragment stored in private field "_columnRenderFragment"

I've noticed that the GetColumns method is called multiple time when doing the rendering without anything external component triggering a render cycle.

Is this by design ?

Hi @Bruno_Giavotto,

The DataGrid will automatically reload itself on the first render. You can attach the source code of Radzen.Blazor to your project to check what and when will be executed.

Hi, Thanks for you reply. I've downloaded the nuget package of RadzenControls however i do not know how to attach the source code to see what's happening. Can you point me in the right direction?

The source code is in our repo, not in the NuGet package: