Hi,
We have 2 grids and first column values in both the grids are same, so we have a requirement when I scroll across the rows in Grid 1, even the grid 2 should be scrolled to the respective row.
Say Eg: Grid 1 has below values
Data 1 "Hi"
Data 2 "Hello"
Data 3 "Welcome"
and Grid 2 has values
Data 1 True
Data 2 False
Data 3 True
Now when I scroll to row containing Data 2 in Grid 1, even the scroll position of Grid 2 should also be at row having the value Data 2.
Thanks un advance.
Regards,
Kiran
Update to above Post we are using Infragistics version 20132.2364 and also enabled virtualization on both the grids.
Thanks,
Hi - Can you please provide suggestions around the above query. Thanks.
Hello Kiran Kumar,
Thank you for posting in our community.
What I can suggest for achieving your requirement is handling jQuery scroll event for the grid scroll contain. In this event current scroll position could be retrieved. Afterwards, using this position to call virtualScrollTo method of the igGrid to scroll the second grid to the desired position. Please note that if the scroll position is passed to the virtualScrollTo method as number it is going to be interpreted as a row number. Because of this the scroll position should be parsed to string. For example:
$('#grid_scrollContainer').on('scroll', function (evtData) { var scroll = $('#grid_scrollContainer').scrollTop().toString() + "px"; $('#grid1').igGrid("virtualScrollTo", scroll); });
$('#grid_scrollContainer').on('scroll', function (evtData) {
var scroll = $('#grid_scrollContainer').scrollTop().toString() + "px";
$('#grid1').igGrid("virtualScrollTo", scroll);
});
I also made a small sample project illustrating my suggestion and I am attaching it for your reference.
Please let me know if you need any further assistance with this matter.
Hi Vasya - The solution provided by you works as expected for us. Thanks for the solution provided.
I am glad that you find my suggestion helpful.
Please let me know if you have any additional questions regarding this matter.