RadzenGrid pagination

Hi,

I'm using the RadzenGrid and i would like to turn the urls friendly with a query parameter for the current page. With this option we can directly navigate to a specific page or reload the current page without restarting at the first page.

I achieved this by using Grid's Render event and retrieving the current page and I update the current URL adding the query parameter without issue.

So when i refresh the page, i can call the LoadData with the Skip info regarding the PageSize and the current page, but the grid is always in the first page. The only way I could implement it by loading the data from page 0 and then call GoToPage(3) for instance.

I do not think this is an optimum way of consuming the service since I need to make two service calls in order to go to the desired page.

There is another way to achieve this functionality ?

Thanks in advance,

Project Spec:

  • .NET 5
  • WASM
  • Blazor

I know this is old, but I'm having the same problem and have yet to find a solution.

Any ideas?

In typical fashion I figured this out immediately after asking.

grid.CurrentPage is the answer

RadzenDataGrid grid;
// loaded from query parameter
int? skip;
int pageSize = 15;
private async Task LoadDataAsync(LoadDataArgs args)
{
	isLoading = true;

	if (skip != null)
	{
		args.Skip = skip;
		grid.CurrentPage = (skip.Value / pageSize);
	}

      // this was only needed for the first page load 
      skip = null;
}