I found a lot of questions about how to resize the form when a child control resizes, but I\'m trying to do something much simpler (maybe so simple people don\'t even ask it
If you want to show the complete headers text
this will auto resize the columns so that the headers will show complete header text.
dataGridView1.AutoSizeColumnsMode = DataGridViewAutoSizeColumnsMode.AllCells;
For Dock Mode
If you want to show the Dock Mode in your panel or form.
dataGridView1.AutoSizeColumnsMode = DataGridViewAutoSizeColumnsMode.Fill;