Select first item in grid with lazy provider

Has anyone succeeded to implement first item in grid when populating data
with lazy data provider. Vaadin 23+

You can do that in the FetchCallback

Simply select the first item if there is no selection

Simon can you please explain it a bit more. I am using AbstractBackEndDataProvider

In the method you fetch the data call with the first item you get

You can use the dataview getItem(0) then select it.

Thank you. It was trivial with DataView.
dataProvider.addDataProviderListener((DataProviderListener) dataChangeEvent → {

        if (grid.getSelectedItems().isEmpty()) {