Scroll to item when paging

1 Answer 14 Views
Grid
Bram
Top achievements
Rank 1
Iron
Iron
Iron
Bram asked on 26 Sep 2025, 09:25 AM | edited on 26 Sep 2025, 09:27 AM

Hi,

The scolling to an item doesn't seem to be working when paging (and not on the correct page).

The demo also doesn't work (click the scroll to item 57 button):

https://www.telerik.com/kendo-angular-ui/components/grid/scroll-modes#scrolling-to-a-specific-item

It there a fix or workaround?

Kind regards

1 Answer, 1 is accepted

Sort by
0
Hetali
Telerik team
answered on 29 Sep 2025, 04:50 PM

Hi Bram,

Thank you for reaching out.

Indeed, when the index is not present in the current page in the Grid with paging, the component does not scroll as specified in the article.

In order to scroll to an item in a different page, you will have to use manual paging and then scroll to the item. For example:

<kendo-grid #grid
  [data]="gridData"
  [pageSize]="pageSize"
  [pageable]="true"
  (pageChange)="pageChange($event)"
>
  <ng-template kendoGridToolbarTemplate>
    <button kendoButton (click)="scroll('ProductID', 70)">
      Scroll to Item 70
    </button>
  </ng-template>
</kendo-grid>
public scroll(field, id) {
  this.skip = this.pageSize * Math.floor(id / this.pageSize);
  this.loadItems();
  
  // Use setTimeout method to make sure the component has changed the page before scrolling
  setTimeout(() => this.grid.scrollToItem({idField: field, id: id }));
}

Output:

In this StackBlitz example, the component scrolls to the desired item present in a different page.

I hope this helps. Please let me know if I can further assist you.

Regards,
Hetali
Progress Telerik

Your perspective matters! Join other professionals in the State of Designer-Developer Collaboration 2025: Workflows, Trends and AI survey to share how AI and new workflows are impacting collaboration, and be among the first to see the key findings.
Start the 2025 Survey
Tags
Grid
Asked by
Bram
Top achievements
Rank 1
Iron
Iron
Iron
Answers by
Hetali
Telerik team
Share this question
or