This is a migrated thread and some comments may be shown as answers.

Grid events (Scroll) or how to scroll two grids simultaneously

3 Answers 504 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Nikolajs
Top achievements
Rank 1
Nikolajs asked on 29 Jan 2013, 12:56 PM
I have two grids on a page (MVC Razor view) and i need them to scroll simultaneously (vertical scroll).  So if I scroll grid2 the grid1 scrolls for the same amount and vice versa. 
I fail to find event for scrolling in .Events of the grid, so I assume there is none.
Maybe there is workaround for this problem.
Please respond even if there is no solution for this problem.

3 Answers, 1 is accepted

Sort by
0
Vladimir Iliev
Telerik team
answered on 31 Jan 2013, 07:02 AM
Hi Nikolajs,

 

Basically this feature is not supported out-of-the-box, however you can achieve it by attaching scroll event handler to the "k-grid-content" element in the grid. When the event is fired you can get current element scrollTop position and apply it to the other grid "k-grid-content" element using the scrollTop method.

Kind Regards,
Vladimir Iliev
the Telerik team
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
0
Bradley
Top achievements
Rank 1
answered on 24 Jan 2018, 04:11 PM

Try this 

<script>
    $('#ChargesByDateGrid .k-grid-content').scroll(function () {
        $("#ChargesByDateGrid .k-grid-content, #ApptNoChgsGrid .k-grid-content").scrollTop($(this).scrollTop());
    });
</script>

<script>
    $('#ApptNoChgsGrid .k-grid-content').scroll(function () {
        $("#ChargesByDateGrid .k-grid-content, #ApptNoChgsGrid .k-grid-content").scrollTop($(this).scrollTop());
    });
</script>

0
Viktor Tachev
Telerik team
answered on 26 Jan 2018, 11:05 AM
Hello Bradley,


Thank you for sharing your code with the community. This can help someone trying to implement similar functionality.


Regards,
Viktor Tachev
Progress Telerik
Try our brand new, jQuery-free Angular components built from ground-up which deliver the business app essential building blocks - a grid component, data visualization (charts) and form elements.
Tags
Grid
Asked by
Nikolajs
Top achievements
Rank 1
Answers by
Vladimir Iliev
Telerik team
Bradley
Top achievements
Rank 1
Viktor Tachev
Telerik team
Share this question
or