@using Syncfusion.Blazor
@using Syncfusion.Blazor.Data
@using Syncfusion.Blazor.TreeGrid
<SfTreeGrid TValue="E"
IdMapping="@nameof(E.Id)"
ParentIdMapping="@nameof(E.ParentId)"
HasChildMapping="@nameof(E.HasChildren)"
TreeColumnIndex="1"
AllowPaging="true">
<SfDataManager Url="https://app.psam.io/api/reference-data-groups"
Adaptor="Adaptors.ODataV4Adaptor" />
<TreeGridColumns>
<TreeGridColumn Field="@nameof(E.Id)" IsPrimaryKey="true" />
<TreeGridColumn Field="@nameof(E.Abbreviation)" />
<TreeGridColumn Field="@nameof(E.CountDirectChildren)" />
TreeGridColumns>
SfTreeGrid>
@code {
public class E
{
public DateTime DateTimeCreated { get; set; }
public DateTime DateTimeLastModified { get; set; }
public Guid Id { get; set; }
public Guid? ParentId { get; set; }
public bool HasChildren { get; set; }
public int CountDirectChildren { get; set; }
public string Abbreviation { get; set; }
public Tp TranslatedProperties { get; set; }
}
public class Tp
{
public string Name { get; set; }
public string Information { get; set; }
}
}
Please note that commenting out this line :
// public Tp TranslatedProperties { get; set; }
solves the TreeGrid issue, but does not satisfy my requirements. Also, such embedded objects work just fine with other Syncfusion controls such as SfrDropDownList.
I've opened up the corresponding endpoint so that you can verify whether you are getting the same error.
Please let me know when embedded objects will be supported in such scenarios.
Best regards
Eugene
Hi Padmavathy,
Thank you for your quick reply.
1. The code I sent to you is the whole code except for a @page directive at the top.
2. I did start with the Hosted Blazor Web Assembly App template
Regards
Eugene Kudryavtsev