To do this, you can use one of the selectRecords() methods, for example:
public void onModuleLoad() { VLayout main = new VLayout(); final ListGrid grid = new ListGrid(); grid.setHeight(500); grid.setWidth(400); grid.setFields(new ListGridField("name", "Name")); grid.setData(createRecords()); final IButton button = new IButton("Select some"); button.addClickHandler(new ClickHandler() { public void onClick(ClickEvent event) { grid.selectRecords(new int[]{2, 3});
source share