PDA

View Full Version : selection in grid



soma13
5 Nov 2011, 4:57 AM
Hi All,

I have a grid and a want to disable the all selection in it. I do not want to allow users to select any rows or cells and I do not want to recolored rows under mouse pointer.

I try to use grid.getSelectionModel().addSelectionChangedListener, but it not working me :(

grid.getSelectionModel().addSelectionChangedListener( new SelectionChangedListener<BeanModel>()
{
@Override
public void selectionChanged(SelectionChangedEvent<BeanModel> se)
{
se.setCancelled(true);
}
});

It doe not work.

Could you help me?

thx, zappee

sven
5 Nov 2011, 5:10 AM
I have a grid and a want to disable the all selection in it. I do not want to allow users to select any rows or cells and I do not want to recolored rows under mouse pointer.


In that case you can simple lock the selectionmodel. There is a setter for it.

soma13
8 Nov 2011, 10:36 AM
Hi seven,

I try to use setLocked(true) but it does not work for me :(

grid.getSelectionModel().setLocked(true);

How can I lock the selection modell?