tomw
October 30, 2024, 8:19pm
1
I'm trying to use the "DataGrid dynamic data support" example below but it doesn't compile. the error says that PropertyAccess does not have a method called GetDynamicPropertyExpression
<RadzenDataGrid @bind-Value=@selectedItems Data="@data" TItem="IDictionary<string, object>" ColumnWidth="200px"
AllowFiltering="true" FilterPopupRenderMode="PopupRenderMode.OnDemand" FilterMode="FilterMode.Advanced" AllowPaging="true" AllowSorting="true">
<Columns>
@foreach (var column in columns)
{
<RadzenDataGridColumn @key=@column.Key Title="@column.Key" Type="column.Value"
Property="@PropertyAccess.GetDynamicPropertyExpression(column.Key, column.Value)">
<Template>
@context[@column.Key]
</Template>
</RadzenDataGridColumn>
}
</Columns>
</RadzenDataGrid>
enchev
October 30, 2024, 9:16pm
2
Make sure you are using latest version of Radzen.Blazor.
tomw
October 30, 2024, 9:36pm
3
thank you, I tried it with the latest 5.5.1 release and still got the same compilation error
enchev
October 31, 2024, 6:41am
4
I’m afraid that I don’t know in this case. You can compare your application implementation with our demos to check what’s different.
tomw
October 31, 2024, 8:49am
5
Actually with v5.5.1 the code now compiles but at runtime it logs this error
Microsoft.AspNetCore.Components.WebAssembly.Rendering.WebAssemblyRenderer[100]
Unhandled exception rendering component: Method not found : string Radzen.PropertyAccess.GetDynamicPropertyExpression (string,System.Type)
System.MissingMethodException: Method not found: string Radzen.PropertyAccess.GetDynamicPropertyExpression(string,System.Type)
at Microsoft.AspNetCore.Components.Rendering.RenderTreeBuilder.AddContent(Int32 sequence, RenderFragment fragment)
at Radzen.Blazor.RadzenDataGrid1[[System.Collections.Generic.IDictionary
2[[System.String, System.Private.CoreLib, Version=8.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e],[System.Object, System.Private.CoreLib, Version=8.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e]], System.Private.CoreLib, Version=8.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e]].b__646_0(RenderTreeBuilder __builder2)
enchev
October 31, 2024, 9:04am
6
I cannot add anything else except what I already suggested.