How to select a grid item by ID?

Given a grid that has some items, how do I select one of the items based on a property such as an ID? My usecase is that when I create a new record, it is loaded in the grid using a wrapper type, and I’d like to be able to select it based on the ID that I saved at creation time. (The grid contains objects of a different type than the item I created, but the IDs will match).

Are you using Vaadin 7 or Vaadin 8?

In Vaadin 8, there is method. This means that you have a property “ID” in your bean, as I assume, you need search the item from your data source, e.g. ListDataProvider. You can do this couple of ways. You may have reference to collection of beans, so you can search (iterate) the list, until you find it. Or you can in some cases use DataProvider.fetch(…) method with suitable Filter in Query to get the item matching the Filter.

This is for Vaadin 8.
I will give it a try.