How to fetch page size of Syncfusion.Grid in Angular project?

Viewed 18

I use Syncfusion in my Angular project. When any paging event changes, I must fetch the grid's current page and page size. I have the following codes:

component.html:

<ejs-grid #Grid class="data-grid" (recordDoubleClick)="onDoubleClick($event)" height="55vh" [dataSource]='dataSource'
            [allowPaging]="true" [allowResizing]="true" [allowSorting]="true" [allowFiltering]="true"
            [pageSettings]='pageSettings' (actionBegin)="onActionBegin($event)">
. . . .
. . . .
        </ejs-grid>

component.ts:

//For paging
  @ViewChild("Grid") 
  public grid!:GridComponent;
  currentPage: number = 1;
  pageSize: number = 50;
  onActionBegin(e: any) {
    this.currentPage = this.grid.pagerModule.pagerObj.currentPage;  
    this.pageSize = this.grid.pagerModule.pagerObj.pagerdropdownModule.dropDownListObject.value
    console.log(this.pageSize)
  }

The problem is that dropDownListObject shows an error and says:

Property 'dropDownListObject' is private and only accessible within class 'PagerDropDown'.

How can I fix this problem?

(Related link)

1 Answers

I solved this problem using the following code:

this.pageSize = this.grid.pagerModule.pagerObj.pageSize
Related