I have a table (Table A) with a related child (Table B) and in the datagrid I am showing the records from Table A and the count of the related children from table B. Now i need to sort and filter on this count but i can't get the syntax right.
<RadzenDataGrid @ref="grid0"
AllowFiltering="true"
AllowSorting="true"
Data="@TableAResult"
TItem="EsWlite.Models.Ecosys.TableA"
>
<RadzenDataGridColumn
TItem="EsWlite.Models.Ecosys.TableA"
FilterProperty="TableC.Unit" Groupable="false"
Property="DefaultUnits"
SortProperty="TableC.Unit"
Title="Unit">
<Template Context="data">
@(data.TableC?.Unit)
</Template>
</RadzenDataGridColumn>
<RadzenDataGridColumn
TItem="EsWlite.Models.Ecosys.TableA"
<!--Throws an error on rendering
I have tried various combo's of this but not foud a working solution
-->
FilterProperty="TableB.ToList().Count().ToString()"
SortProperty="TableB.ToList().Count().ToString()"
Title="Class">
<Template Context="data">
@(data.TableB?.Count())
</Template>
</RadzenDataGridColumn>
Is there a way or do i have to create a custom method and build the datagrid around a new class?