First, I created a Panel called "Footer" and set the Dock = Bottom and then I created the DataGridView and set the Dock=Fill. Now I want to add another Panel called "Header" and set the Dock=Top. However, when I do that it covers part of the DataGridView.
Does anyone know how I can fix this?
I guess what you want is the DataGridView fill the middle part between the two panels. If I'm off base, please correct me.
The cause of the dataGridView will be coverd by panel "Header" is because when you do the drag and drop the DataGridView, it drops inside the panel "Header", that is to say, you will find in Form1.Designer.cs code "this.Header.Controls.Add(this.dataGridView1);", it means the DataGridView belongs to the panel. All you have to do is make the DataGridView belongs directly to the form, not the panel "Header", you can copy it out from panel "Header" to the form, that will lead the Form1.Designer.cs automatically coding "this.Controls.Add(this.dataGridView1);"