Radzen Grid : Creating and filling columns dynamically

Could it be a capture issue? Try creating a copy of the loop index:

@for (int j = 0; j < this.NumberOfDifferentiatingAttributes; j++)
{
    @{ int columnIndex = j; }
   <RadzenGridColumn TItem="MyViewModel" Title="@(SubArticles[0].Attributes.Label)" Sortable="false" Filterable="false" Width="200px">
        <Template Context="data">                                                           
          @(data.Attributes[columnIndex].Value)
       </Template>
   </RadzenGridColumn>
}
1 Like