Select row in grid with lazy load

I want to select ( row in grid after edit or new item. Grid has DataProvider which lazy load data from service.
Which event user or other way to recognize when items is displayed in grid?

Not sure what you mean; I assume that you call DataProvider.refreshAll() after an item has been edited, or a new item has been added to the collection. There you can update the selection by; you can also use DataProvider.addDataProviderListener() to hook into the refreshAll() call. You can also call even when the item is not yet fetched into the Grid itself - the Grid should select the row properly after the data is fetched.

Thank you, but not working:


With “DataProviderListener” not working too:

DataProviderListener<Employee> dataProviderListener = new DataProviderListener<Employee>() {
      public void onDataChange(DataChangeEvent<Employee> event) {;

If there is real framework issue, it sounds a bit similar to discussion here

If you overwrite equals in your Employee data class then it will work.
This function is not working:

public Boolean equals(Employee e) { return e.getId().equals(id); }

It should be something like that:

public boolean equals(Object other) {
if (id == null) {
return super.equals(other);

return this == other || other instanceof Employee && id.equals(((Employee) other).id);

Thanks, solved!

Other problem, after this row not de-selected after clicking on other rows. Grid in Single select mode.

Problem with grid.getDataProvider().refreshAll(); after this row selected and no way to deselect.

Sorry, was fixed in newest Vaadin framework.