RadzenPager GoToPage does not reflect the current page

We are following the recommendation to initialize the current (start) page: How to set Radzen.Blazor's Pager starting page on load? - #2 by enchev .
Since we upgraded to NET10 from NET9 the current page is not reflected in the page selector, which can be reproduced in the demo.

  1. add a ref for the RadzenPager: <RadzenPager @ref="_pager" ... />
  2. add a private field: RadzenPager _pager;
  3. add the following method:
    protected override async Task OnAfterRenderAsync(bool firstRender)
    {
    if(firstRender)
    {
    _pager.GoToPage(2);
    }
    }

Expected Behaviour:
The RadzenPager highlights Page 3.

Actual Behaviour:
The RadzenPager highlights Page 1, although _pager.CurrentPage is 2 (Index).
The content of page 3 is displayed.
Clicking on > (Next page) jumps to page 4.

  1. Adding a button and calling GoToPage outside the blazor life cycle instead of the OnAfterRenderAsync does also not change the page in the _pager, only the content.

    <RadzenButton Click="ChangePage" /> void ChangePage(){ _pager.GoToPage(2); }

Tested Version: "Radzen.Blazor" Version="8.7.3"

Thank you in advance.

1 Like

Same issue here, we also use GoToPage on first render. Also went more generic and simply call GoToPage on the first render where _pager is not null (and then remember not to do it again). Still not updating. Internally it knows the page has changed, but it doesn’t render the controls. Also tried StateHasChanged();await Task.Yield(); after the GoToPage. Still the same problem.

Thanks for the report! The fix will be part of our next update early next week: