Set datagridview size dynamically

aspfun

Active member
Joined
Feb 16, 2010
Messages
34
Programming Experience
5-10
How to set datagridview size (height) dynamically?
I need to set up a datagridview height on run time based on how many record will load.
 
Figure out the height of a single row based on your interfaces font & fontsize and multiply that by the table record count and set the size of the dgv to the total. Or do you need more detail such as your given the user the ability to change font & fontsizes at runtime?

However all that aside I would just use the anchor properties to grow/shrink when they resize the form otherwise you have to worry about the grid being larger then the form, covering other controls, needing to move its top & left properties as it resizes etc
 
Back
Top