I have a DataGridView that displays a limited number of rows, never more than 5. This DataGridViewis placed on a DataRepeater control so it's usually displayed many times on the screen. What I want to achieve is that all grids are resized to the size of their contents so they don't display scroll bars if 4 or 5 items are in them or take up extra vertical space if only 1 or 2 items are there.
The grids only contain text data. They are data bound controls, so they'll need to resize if the underlying data source changes (I guess the DataBindingComplete event would be suitable).
How may I achieve this? Is counting rows the best option? Thanks in advance.