Resize ListView to prevent scrolling

Hi everyone,

I’m creating a ListView with an unknown number of items. Sometimes this causes a vertical scrollbar to be shown, because there are too many items for the size of the control.

How can I automatically size the ListView so it’ll be big enough for a scrollbar to not be needed?

Thanks for your help,

Ram Rachum.