Vaadin 8 Grid MultiSelect limit (maximum select)


I need help for MultiSelect grid. I would like to set the maximum selectable row in the grid.
For example I want to set 2 selectable row in the grid.
How can I do that?

    Grid<Person> grid = new Grid<>();
    grid .setSelectionMode(SelectionMode.MULTI);
    // grid.setMaxiumomSelectableRow(2);

Thanks your help!

I think you could look into creating a custom SelectionMode, by extending the SelectionModel interface.