GridLayout: Contained panels don't fill out cells or height does not adapt

I need to create a View, that consists of several panels. The View has VerticalLayout and one of its components is GridLayout. This GridLayout contains the panels. The panels have a caption, the content of the panels is GridLayout with several input fields.

The problem: The panels don’t fill out the cells of the general GridLayout - as you can see in the attached example “UndefinedHeight”.
The height of the GridLayout and of the contained components is undefined.

If I change the width to 100%, the outcome is like in the second attachment “100PerCentHeight” - the cells are filled out, but they have all the same height. Therefore some fields are not longer visible.

My question: How do I have to define the height, so that the panels fill out all cells and the heights of the grid rows adapt to its content?