When I place a data grid view on a form, with Dock = DockStyle.Fill, I can shrink the form down to less than one row remaining before there are any issues with the data grid view scroll bar. However if I place it inside a table layout panel that is in turn docked to the form, the data grid view starts to act as though it has a minimum height, cutting off the bottom rows and bottom of the scroll bar.

public Form1()
{
InitializeComponent();
BindingList<Widget> list = new BindingList<Widget>();
dataGridView1.DataSource = list;
for (int i = 0; i < 100; i++)
{
list.Add(new Widget { MyProperty = i });
}
}
private void InitializeComponent()
{
this.tableLayoutPanel1 = new System.Windows.Forms.TableLayoutPanel();
this.dataGridView1 = new System.Windows.Forms.DataGridView();
this.tableLayoutPanel1.SuspendLayout();
((System.ComponentModel.ISupportInitialize)(this.dataGridView1)).BeginInit();
this.SuspendLayout();
//
// tableLayoutPanel1
//
this.tableLayoutPanel1.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Absolute, 20F));
this.tableLayoutPanel1.Controls.Add(this.dataGridView1, 0, 1);
this.tableLayoutPanel1.Dock = System.Windows.Forms.DockStyle.Fill;
this.tableLayoutPanel1.RowCount = 2;
this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 30F));
this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle());
//
// dataGridView1
//
this.dataGridView1.Dock = System.Windows.Forms.DockStyle.Fill;
//
// Form1
//
this.ClientSize = new System.Drawing.Size(976, 518);
this.Controls.Add(this.tableLayoutPanel1);
this.tableLayoutPanel1.ResumeLayout(false);
((System.ComponentModel.ISupportInitialize)(this.dataGridView1)).EndInit();
this.ResumeLayout(false);
}
I tried adding this.tableLayoutPanel1.AutoScroll = true; which showed it was the data grid that was not resizing, the panel scroll bar was correctly placed and not cut off.
Similar questions without an answer that worked for me: