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.
- add a ref for the RadzenPager:
<RadzenPager @ref="_pager" ... /> - add a private field:
RadzenPager _pager; - 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.
-
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.