Syncronize scrolling of 2 grids

1 Answer 47 Views
Grid
Bernd
Top achievements
Rank 5
Bronze
Bronze
Bronze
Bernd asked on 04 Oct 2022, 03:09 PM

Hi.

I have 2 Grid components sitting next to each other and I would like to sync the scrolling of both so that if I scroll with the one on top, the one on the bottom is scrolling too and vice versa.

I have setup an example here of what I tried so far without success:

https://stackblitz.com/edit/react-h86fcx-cfss5a?file=app%2Fmain.tsx

Any help would be appreciated.

Greetings,

Bernd

1 Answer, 1 is accepted

Sort by
1
Accepted
Konstantin Dikov
Telerik team
answered on 06 Oct 2022, 07:38 AM

Hi Bernd,

I have tested the example and the issue was that the elements for which you are trying to set the scrollTop (and retrieve) are not the scrollable containers, but their parent element. I have modified the example accordingly, so it get reference to the correct elements:

Hope this helps.

 

Regards,
Konstantin Dikov
Progress Telerik

Love the Telerik and Kendo UI products and believe more people should try them? Invite a fellow developer to become a Progress customer and each of you can get a $50 Amazon gift voucher.

Tags
Grid
Asked by
Bernd
Top achievements
Rank 5
Bronze
Bronze
Bronze
Answers by
Konstantin Dikov
Telerik team
Share this question
or