Grid and preserving selection

Hi. I am back on this problem.

Here is a simple code:

public void onCLose(Crud crud, DataRow dataRow) {

    grid.deselectAll();

    grid.getDataProvider().refreshAll();
    grid.select(dataRow);
    grid.scrollToItem(dataRow);

The problem is, that index in my DataRow isn’t updated with the refreshed one.