How to set the checkbox selected in the first record on the Listgrid?

StackOverflow https://stackoverflow.com/questions/20421035

  •  29-08-2022
  •  | 
  •  

سؤال

my ListGrid already set .setSelectionType(SelectionStyle.SIMPLE) and .setSelectionAppearance(SelectionAppearance.CHECKBOX),but now I want to set the checkbox of the first record true when loaded some records.So,how can I code it ?

هل كانت مفيدة؟

المحلول

Try the following:

listGrid.addDataArrivedHandler(new DataArrivedHandler() {
    @Override
    void onDataArrived(DataArrivedEvent event) {
        listGrid.selectRecord(0);
    }
});
مرخصة بموجب: CC-BY-SA مع الإسناد
لا تنتمي إلى StackOverflow
scroll top