If you pass the bean class to the Grid structure, then it will add all the properties as columns to the grid.
If you want to have only some properties as columns, then do not pass the class to the constructor and manually add your columns:
grid.addColumn(Address::getStreet);
grid.addColumn(Address::getHouseNumber);
grid.addColumn(Address::getPostalCode);
grid.addCOlumn(Address::getCity);
If you want to add the created column just add it using addColumn
grid.addColumn(address -> {
return address.getStreet() + " " + address.getHouseNumber();
});
source
share