Hi all !
I'm in front of a problem : I got two webgrids vertically aligned in my page. The top grid has a horizontal scrollbar at the bottom. I want to make this scrollbar scrolling the two webgrids at the same time. I don't know how to do that because the webgrids don't have a scrolling event handler.
Could someone help me please ?
Bye
Hi !
Finally I found a working solution. Here is the code :
function dgvStade1_InitializeLayout(gridName) { var grid = igtbl_getGridById(gridName); if(ig_shared.IsFireFox) { grid.getDivElement().addEventListener("scroll", GridScrolled, false); } else { grid.getDivElement().onscroll = GridScrolled; } } function GridScrolled() { var grid1 = igtbl_getGridById("tcl_PCG__ctl2_dgvStade1"); var grid2 = igtbl_getGridById("tcl_PCG__ctl2_dgvStade2"); grid2.getDivElement().scrollLeft = grid1.getDivElement().scrollLeft; }
Correctly specify the grids IDs was the solution.
My page architecture : UltraWebTab:tcl_PCG->ctl2->UltraWebGrid:dgvStade1
Thank you for your help !
Regards
Unfortunately this doesn't work. I'll tell you if I find the solution
Try replacing those lines in this way
var grid1 = igtbl_getGridById("<%= dgvStade1.ClientID %>");
var grid2 = igtbl_getGridById("<%= dgvStade2.ClientID %>");
With your sample the GridScrolled() is well triggered when I move the scrollbar, but I have a Null Exception on this line :
grid2.getDivElement().scrollLeft = grid1.getDivElement().scrollLeft;
Maybe the following lines don't work to get the grids :
var grid1 = igtbl_getGridById("dgvStade1"); var grid2 = igtbl_getGridById("dgvStade2");
I'm working on it.
Hi,
I didn't reply earlier because I didn't work last 4 days. Thanks for your sample, I check it right now and tell you after.