I\'m using VS2008\'s designer for doing this.
For example if I\'ve a windows form of size say 500x500 and I added a DataGridView to it (490x490).
when I run
You can ether set the Dock-Property of your DataGridView instance to DockStyle.Fill or use the Anchor-Property and set the anchors to:
dataGridView.Anchor =
AnchorStyles.Bottom |
AnchorStyles.Right |
AnchorStyles.Top |
AnchorStyles.Left;
The first method will make your DataGridView to fill your whole client area. The second method will keep the ratio and only resize the control if the container resizes.