and Trying to print the values of each row i m not able to print . can anyone help this.
Here is my code
Grid grid = new Grid<>();
grid.setWidth(“100%”);
grid.setColumnReorderingAllowed(true);
grid.setSelectionMode(SelectionMode.SINGLE);
ArrayList personDataList = new ArrayList();
for (int i = 0; i <= 15; i++) {
PersonData p = new PersonData();
p.setId(100);
p.setName(“AAA”);
p.setWeight(50.20);
p.setDob(new Date());
personDataList.add(p);
}
grid.addColumn(PersonData::getName).setCaption(“Name”);
grid.addColumn(PersonData::getWeight).setCaption(“Weight”);
grid.addColumn(PersonData::getDob, new DateRenderer(new SimpleDateFormat(“yyyy-MM-dd HH:mm:ss”)))
.setCaption(“DATE”);
grid.setItems(personDataList);
You need to get the Grids DataProvider (there is getDataProvider), which in default case is ListDataProvider. Check the API of ListDataProvider how to iterate values.
This is giving me the proper values.
but when i pass other POJO class insted of PersonData that will have other field insted if getId() .
is there a way that i can get the data by column.
i am trying to export the complete Grid data into excel file including column names also.
Any solution for the above problem. I am having the same problem as Nagaraj RC. I need to migrate all the grid data to excel. Please let me if you have solutions. Thank you.