Get toal count of items when paginated

Hello,

in actionBegin I need the total number of items that are in the grid. I tried 

this.grid().getCurrentViewRecords().length 

but this does not work when data is paginated since it will only return valid number if the count is <= page size.

I use OData and there the count property is set co

Regards,
Michael


3 Replies 1 reply marked as answer

AR Aishwarya Rameshbabu Syncfusion Team July 8, 2025 12:14 PM UTC

Hi Michael Mairegger,


Greetings from Syncfusion support.


Based on the provided details, it has been noted that you want to get the total number of items present within the Grid. Currently, you are utilizing the ODataAdaptor to retrieve the data from the server. The total record count can be accessed through the `count` property within the arguments of the `beforeDatabound` event of the Grid. However, it appears that you require this count during the 'actionBegin' event of the Grid. In this event, the total record count can be accessed using the `totalRecordsCount` property within the pageSettings of the Grid as `grid.pageSettings.totalRecordsCount`.


API References:

pageSettings

beforeDataBound


If you need any other assistance or have additional questions, please feel free to reach out us.


Regards,

Aishwarya R


Marked as answer

MM Michael Mairegger July 9, 2025 07:38 AM UTC

Thank you for the solution



AR Aishwarya Rameshbabu Syncfusion Team July 11, 2025 06:05 AM UTC

Hi Michael Mairegger,


You are most welcome. Please get back to us if you need any other assistance.


Regards,

Aishwarya R


Loader.
Up arrow icon