I am unsure how to proceed and would appreciate some guidance. I currently have a tree that has 'hooks' to OnLoad, OnExpand, and OnChange like
<RadzenTree Change=@OnChange Data=@standardList Expand=@OnLoad Style="width: 100%; height: 300px">
When responding to those events I would like to call asynchronous methods (methods that return Task<T>
. The problem is that the event handlers are not asynchronous so I don't have the option to 'await'. In the code-behind then simply look like
protected void OnChange(TreeEventArgs args)
{
. . . .
}
And when I explicitly wait for the return of my asynchronous calls by turning them into synchronous calls by appending .Wait()
or .Result
I get an exception from the library indicating that during rendering I cannot wait. So what am I to do in this case?
Thank you.