Welcome to the Blazor feedback portal. We’re happy you’re here! If you have feedback on how to improve the Blazor, we’d love to hear it!>
Thanks for joining our community and helping improve Syncfusion products!
If you use a basic example of a TreeGrid and try to populate its data with async call, TreeGrid always shows "No records to display".
If you call the async method with ContinueWith, then you get the populated data. Similarly if you wrap the call in Task.Run(....).Wait() to force it to be synchronous. Basically it looks like TreeGrid does not respect the awaiter pattern and look for source updates.
For example, if in OnInitializedAsync you try to set the datasource to the result of an await for the following code:
public async Task
> ItemsAsync()
{
return await Task.Run(() =>
{
return new List
() {
new GetItem(){ Id=1, ParentId=null, Name="test1"},
new GetItem(){ Id=2, ParentId=null, Name="test2"},
new GetItem(){ Id=3, ParentId=2, Name="test3"},
};
}).ConfigureAwait(false);
}
then this will get you "No records to display" .
This means that I cannot actually call a web API from OnInitializedAsync , making TreeGrid practically unusable in my scenario.