LoadData always triggered

Maybe i don't understand the concept entirely but I hope someone can help me.

On my route "/organization" I have a RadzenGrid wit a LoadData event which fetches the rows. (I have a call to this method in the Task OnInitializedAsync() method otherwise the grid won't get populated as i visit the page.)

If i now edit a row by going to the route /organization/edit/mycompany and then go back by navigating back to /organization the Loaddata gets triggered but the filtering / sorting / pagenumber is reset (the grid is reloaded) this is not what i want. Te filtering / sorting / pagenumber should stay the same.

It both happens if i :

  • create a seperate edit page and navigate back
  • use one page with double route one for overview one for edit.

Am i doing something stupid ?

Hi @siebejan,

I think this is expected. The Blazor router instantiates the components every single time. Hence their state (current page, filter etc.) is lost.

Goodafternoon mr. Korchev,

Thank you for your answer, strange, I would expect my problem to be a quite common scenario.

I've looked into it some more:
If I open the page [OnInitializedAsync] is called.
I sort the grid, [LoadData] is called
I click on an edit link to view the details [OnParametersSetAsync] is called, details are show.
I click on the return link [OnParametersSetAsync] is called again.

The grid is shown, but [OnInitializedAsync] and [loaddata] is not called still the grid is populated. Only the sorting / filter / pagenumber has been reset.

I think the radgrid component is initialized again with the variables which are passed trough the properties (data property) are used. Because the LoadDataArgs is not an available property this information is then lost.

Maybe it would be an idea to make it possible to pass the LoadDataArgs as a property ? I think it then would all work as expected.

The only solution I can think of now would be the solution u showed in de [container]-[steps] demo but then i cannot make use of the routing.

P.s. The pagenumber and filter only work initially if I sort a column first, that is quite strange also ?

Hello mr Korchev,

This problem is still on my list. Is there any way to save the state and pas this saved state back to the grid ? I see a Query property but this is read only.

The problem is that people want to get back to the list while keeping the sorting / filtering.
I can try to keep al the functionality in one (route) component but that feels like a bad solution.

This is currently not supported by the RadzenGrid.