You donβt have time to try, but the DataGrid implements the HasRows interface, and HasRows, among other things, has a setVisibleRange method. You just need to find out the line number of the element you want to focus on, and then set the visible range from this number n to n + 50. Thus, the DataGrid will reset to put this element at the top (or near the top, if it is in the last 50 elements list supporting DataGrid). Remember to redraw your DataGrid.
Have you already looked at this? If so, I would be surprised that this did not work.
Oh, and since this is one widget talking to another, you probably have some messaging setup and some message handlers, so when a user interacts with this second widget and selects an item, the message fires on the EventBus and the handler for This message captures the DataGrid in the lines described above. I think you will have to do this wiring yourself.
Steve j
source share