View Full Version : Grid with default selection of the first row

14 Jan 2010, 6:01 AM
Hi All,

I am creating a Grid using

Grid<BeanModel> grid = new
Grid<BeanModel>(ListStore<BeanModel>, ColumnModel);
statement. I am able to see the data in the grid, but i want to show the first row of the grid as selected? how i can do this? can anybody please give me some solutions.

Thank you.

14 Jan 2010, 8:36 AM
Moved to GXT help. Post in the correct forums next time :)

14 Jan 2010, 5:22 PM
Try this:

grid.getSelectionModel().select(0, false);

15 Jan 2010, 10:27 AM
but only after the store is loaded ;-) so you need to look for the event when the store is loaded.

15 Jan 2010, 11:18 AM
Good point:

store.getLoader().addListener(Loader.Load, new Listener<LoadEvent>()
public void handleEvent(LoadEvent le)
tableGrid.getSelectionModel().select(0, false);