IgxGrid Angular – Set scroll location using API
New DiscussionHi,
I am trying to set the scroll location (basically go to top of grid) after some action is done. The grid in question is using virtualization and the data is fetched and set using the onDataPreLoad.
In a particular scenario, I would like the grid to scroll back to the top (index 0). I tried a couple ways of doing this, but none of them seem to be working.
- Using the navigateTo method in IgxGridComponent
- Setting the verticalScrollContainer.scrollPosition value to 0 (and even doing a refresh grid / reflow / cdr.detectChanges)
- Using the scrollTo method in the verticalScrollContainer
Is there a better way to set the vertical scroll location ?
Little more description is that I am having a 10000 row data, showing around 20 of them at a time. When an action happens, I kind of change the layout of the grid (adding / removing some columns and changing the format of the data). When this happens, the scroll position is being retained and that is causing an issue when the next onDataPreLoad runs.