that's not a special case. Just use the RowSelectionModel instead of the default SelectionModel. You can see how this works in the Selection_events example:
selectionLayer.setSelectionModel(new RowSelectionModel<RowDataFixture>(selectionLayer, gridLayer.getBodyDataProvider(), new IRowIdAccessor<RowDataFixture>() {
public Serializable getRowId(RowDataFixture rowObject) {
return rowObject.getSecurity_id();
}
}));
Thank you for your reply. I already tried that but the problem is that with that RowSelectionModel when I click on a column all rows get selected even when I don't allow multiple selection.
Did you implement the getRowId() correctly? This is needed to identify the row to select by model.
Or do you mean on clicking the column header all rows get selected? Well this is because on clicking at the column header, the default behaviour is to select every cell of that column. And with using the RowSelectionModel of course all rows get selected. If you want to avoid this, you need to disable the selection behaviour on clicking the column header. This can be done by overriding and modifying the DefaultSelectionBindings.configureColumnHeaderMouseClickBindings() method.
How did you override configureColumnHeaderMouseClickBindings()?
I tried this for the Selection_events example by adding this to the RowOnlySelectionBindings (which override DefaultSelectionBindings) and there is nothing selected if I click on the column header: