onRowSelect for setSelectedRow, horizontal scrollbar moves

When i use the following code, it works perfectly. The grid is displayed with a specified row selected, and if the end-user decides to deselect that row, it re-selects it.

But here is the issue:
If the viewing window within the xGrid is a ceratin size, and has many columns, and the end-user uses the horizontal scrollbar to move anywhere on the right (even the far right), and clicks on the row, the onRowSelect is called and repositions the scrollbar back to the left hand side.

Is there anyway to stop this event from moving the scrollbar to the left?

mgrid.attachEvent(“onRowSelect”, function(id,ind) {mygrid.setSelectedRow(mygrid.getRowId(value));});

Any help/information is much appreciated!

Try to use selectCell() method method instead of setSelectedRow():

mygrid.attachEvent("onRowSelect", function(id,ind) { mygrid.selectCell(mygrid.getRowIndex(id),ind); });

:open_mouth: That fixed the issue! Thank you so much!!! :stuck_out_tongue: