$(function () { $("#checkboxforscrollbarsyncHorizontal").change(function () { if (this.checked) { // The following code was written to try to rebind the header bar with its scroll event // $('#firstscrollbarlb .t-grid-content').unbind("scroll"); // $('#secondscrollbarlb .t-grid-content').unbind("scroll"); firstscrollbarlb $('#firstscrollbarlb .t-grid-content').scroll(function () { var varforfirstscrollbar = $(this).scrollLeft(); $('#secondscrollbarlb .t-grid-content').scrollLeft(varforfirstscrollbar); }); $('#secondscrollbarlb .t-grid-content').scroll(function () { var varforsecondscrollbar = $(this).scrollLeft(); $('#firstscrollbarlb .t-grid-content').scrollLeft(varforsecondscrollbar); }); }); } else { $('#firstscrollbarlb .t-grid-content').unbind("scroll"); $('#secondscrollbarlb .t-grid-content').unbind("scroll"); } }); })(checkboxcheckerHorizontal);
<table> <tr> <td id="firstscrollbarlb"> //The Telerik Grid code goes here </td> <td id="secondscrollbarlb"> //The Telerik Grid code goes here </td> </tr> </table>
<input type="checkbox" id="checkboxforscrollbarsyncHorizontal" onClick="checkboxcheckerHorizontal();"/>Horizontal
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)