Only show pagination if row count greater than 10

Hi,


I want to hide the paginator if my row count is equal or less than 10, how can I do this please?


1 Reply

JC Joseph Christ Nithin Issack Syncfusion Team April 7, 2022 12:20 PM UTC

Based on your requirement, you want to show the pager component only when the row count is greater than 10 and you want to hide it when the row count is equal or less than 10. You can achieve your requirement by enabling and disabling the `allowPaging` property of the Ej2 Grid in the `dataBound` event of the grid.


Please refer the below code example:


 

dataBound() {

    if (this.grid.getRows().length > 10) {

      this.grid.allowPaging = true;

    } else {

      this.grid.allowPaging = false;

    }

  }

 


Sample: https://stackblitz.com/edit/angular-pbnbnz?file=app.component.ts


Please get back to us for further details.


Loader.
Up arrow icon