How to define the number of pages, custom binding

Hi all, I have an endpoint to return data in a paginated way, actually the endpoint returns the following information:

{
  "totalItems": 100,
  "currentPage": 1,
  "totalPages": 5,
  "items": []
}

i need to bind this object to the grid, i can pass the items to the grid, but i'm wondering on how the grid can show me 5 pages? and after that how to get the page number clicked.

BTW, If needed, i can change the property names.

Thanks!

1 Reply 1 reply marked as answer

JP Jeevakanth Palaniappan Syncfusion Team August 3, 2020 12:16 PM UTC

Hi Julio, 

Greeting from Syncfusion support. 

Query : I need to bind this object to the grid, I can pass the items to the grid, but I'm wondering on how the grid can show me 5 pages? and after that how to get the page number clicked. 

From the query we understood that you want to handle grid operation(paging etc) externally. To achieve this we suggest you to use custom binding in grid. Override the ReadAsync method of your custom adaptor to send request to your web api and feed the result and count to the grid as a instance of DataResult.  
 
Please find the below documentation link for your reference. 
 
Reference links: 

Please get back to us if you need further assistance. 
 
Regards, 
Jeevakanth SP. 


Marked as answer
Loader.
Up arrow icon