Vertical scroller for gridlayout


I would like to create a gridlayout with

  • no vertical scroller if the grid contains less than 5 lines
  • a vertical scroller if the grid contains more than 5 lines.

How to do that ?
GridLayout gridDynamic = new GridLayout(4,int_numberOfLines);


Hi there. No answer ? Maybe it means there is no solution ?
I tried to use setHeight(“50px”) but no vertical scroller appeared …


Don’t expect getting an answer after 20 hours. Good answers sometimes can take up to a few days if not longer.

You probably want to use a Panel. It has scrolling functionality built-in.
For example:
if your panel’s height is 200px and you have a layout as its content which is 300px high you will get a vertical scrollbar to scroll to the full 300px.

Yeah, Panel is the basic way. You can also get scrollbars by setting a fixed height for the GridLayout and then defining “overflow: auto” for it (v-gridlayout element) in the theme.

As you said, i put the layout into a panel and it works fine.
Thank you for your help Marius