Vaadin 8.2 opening grid editor programatically

I have again a question.
Since Vaadin 8.2 it is possible to open the editor programatically.

In my case I have a grid and a button to add a new row. With this button I want to add a new line to the grid and directly open the editor on that row.

The .editRow function of the grid editor needs a rowNumber. I have no idea how to get the correct rowNumber.
In cases the grid is not sorted, the new object is always the last line. So the following code works:

grid.getEditor().editRow(newList.size() - 1);

But if there is a sort order set for the grid, the new row is not always the last one.
I tried to find the row by iterating the dataProvider, but that is NOT the same order than in the grid.

How can I get the rowNumber of a certain grid object?

thank you