You can recalculate grid height inside details generator using your data container. Its not the final solution, however it works perfect for my needs which is dynamicly changing grid height without scrollbar inside.
Grid table...
table.setHeightMode(HeightMode.ROW);
table.setDetailsGenerator(new DetailsGenerator() {
public Component getDetails(RowReference rowReference) {
table.setHeightByRows(tableContainer.getItemIds().size() + 4);
//detalis height is constant so I solve this by adding extra space which equals the size of 4 the rows
//
//for filtered container you can use tableContainer.getVisibleItemIds()
}
}
Hope that help. If u find better solution please post it here. I didnt chech that but what about marking component as dirty inside details generator?