views:

118

answers:

2

I need to set up a windows form DataGridView, programmatically bound to a list, such that only 6 rows are visible to the user (i.e. the grid's height is only 6 cells) and a scroll bar appears when there are more than 6 elements in the bound list. All the rows need to be of the same height. Is there a configuration of properties that does this or do I have to manually set the height of the DataGridView so that only 6 rows would be visible?

+1  A: 

Set the size of the control such that at most 6 rows are visible, and set the Scrollbars property so that the vertical scrollbar appears as needed (to Vertical, or Both if you need a horizontal scrollbar as well).

John at CashCommons
+1  A: 

If I understand your question correctly, you're wanting to use paging on the datagridview. If this is correct try this and this. It's a bit convoluted though.

Dave7896
Very useful links but I used the solution above, thanks
Ahmed Chaudhary