Scrolling the grid progrematically to the last item

how could I programmatically scroll to the bottom of the grid? so lets say I call a function and then scrolling a specific grid to the last item.


1 Reply

VS Vikram Sundararajan Syncfusion Team January 30, 2024 12:11 PM UTC

Hi Jonas Blazinskas,


Greetings from Syncfusion support,


Based on your query want to scroll the grid to the bottom programmatically. You can achieve your requirement by using scrollTop method. Please refer the below code snippet for more reference,


app.component.ts

 

click(): void {

    const contentElement = this.grid.getContent().firstElementChild;

    const scrollHeight =

      contentElement.scrollHeight - contentElement.clientHeight;

    contentElement.scrollTop = scrollHeight;

  }

}

 


Sample: https://stackblitz.com/edit/angular-shccqx-qgwygf?file=src%2Fapp.component.ts


Please let us know if you need any further assistance.


Regards,

Vikram S



Loader.
Up arrow icon