How to refresh component tree

Good morning Radzen community.

I developp an application including a component tree. All components do not need to use parameters nor cascading parameters for the moment.
I use also a service which provides data to all these components.

My question :
What is the best way to refresh the complete component tree ? That refresh will ask each component to verify if some updates are necessary.
I feel (perhaps it is wrong) that a StateHasChanged fired at the top level component will not reach all the children components.

Thanks for any advice.
Serge.

Hi @safournier,

In my opinion StateHasChanged() is the proper way to do that - let the Blazor framework decide what to be refreshed. The full refresh can be invoked only if you force refresh of the entire page.

Hi and thank you @Enchev for your fast answer.

My problem is that each chid component must call the service to know if some modifications have occured. The service may present a boolean or anything else to tell if some new data are present but obviously, the component must call it to check new data arrival.

Can you confirm that if I apply a StateHasChanged to a parent component, it will generate refresh to all its children ?

@safournier

Hey @safournier,

I'm not entirely sure what's your scenario however you can check the official Microsoft documentation for reference:

This thread also might be helpful:

Thank you @Enchev.

I understand that my problem is more related to Blazor, not to Radzen components.

:ok_hand:

@safournier