Radzen Datagrid don't update page number

Is there a parameter responsible for displaying the current page number? I can't update it, it keeps getting the value 1.
Radzen version 5.1.3

<RadzenDataGrid @ref="shopsGrid" AllowPaging="true" AllowColumnResize="true"
				PageSize="@pageSize" PageSizeOptions="@pageSizeOptions" Count="@totalItems"
				LoadData="@LoadData" AllowSorting="true" EditMode="DataGridEditMode.Single"
				Data="@shops" TItem="ShopDTO" ColumnWidth="200px">
	<Columns>
		<RadzenDataGridColumn TItem="ShopDTO" Property="Code" Title="Skrócona nazwa" Width="120px">
			<Template Context="ShopDTO">
				@ShopDTO.Code
			</Template>
		</RadzenDataGridColumn>
	</Columns>
</RadzenDataGrid>

code

IEnumerable<int> pageSizeOptions = new int[] { 5, 10, 20, 30 };
RadzenDataGrid<ShopDTO>? shopsGrid;
IList<ShopDTO>? shops;
private int totalItems;
private int pageSize = 5;
public bool isLoading = true;
private async Task LoadData(LoadDataArgs args)
{
	var paginationParams = PaginationHelper<ShopDTO>.CreatePagination(args);
	var result = await _shopService.GetAllPagining(paginationParams);
	if (result.Succeeded)
	{
		shops = result!.Value.Items.ToList();
		totalItems = result.Value.TotalItems;
		pageSize = result.Value.PageSize;
	}
}

Hi @Norbert,

Your code seems correct. Make sure that totalItems and pageSize are correct - the Count attribute is important for paging to work as expected. You can also try not updating PageSize - use a constant value to see if it makes any difference.

In my case the problem turned out to be the isLoading flag. I will show the code prototype, maybe it will help someone. I totally did not expect this cause of the error.
And thanks for the answer :wink:

@if (!isLoading)
{ 
<RadzenDataGrid @ref="shopsGrid" AllowPaging="true" AllowColumnResize="true"
	PageSize="@pageSize" PageSizeOptions="@pageSizeOptions" Count="@totalItems"
	LoadData="@LoadData" AllowSorting="true" EditMode="DataGridEditMode.Single"
	Data="@shops" TItem="ShopDTO" ColumnWidth="200px">
<Columns>
<RadzenDataGridColumn TItem="ShopDTO" Property="Code" Title="Skrócona nazwa" Width="120px">
<Template Context="ShopDTO">
	@ShopDTO.Code
</Template>
</RadzenDataGridColumn>
</Columns>
</RadzenDataGrid>
}
else
{
<RadzenProgressBarCircular Mode="ProgressBarMode.Indeterminate" Size="ProgressBarCircularSize.Medium">
<Template>Wait</Template>
</RadzenProgressBarCircular>
}