I'm trying to build a table that is autoscrollable and I took inspiration from this example: Add Row Dynamically in TableLayoutPanel.
I already set on autoscroll true and I created only 3 static columns for my case but autoscroll doesn't work.
Example of my code:
panel.ColumnCount = 0;
panel.RowCount = 0;
panel.RowStyles.Add(new RowStyle(SizeType.Absolute, 30F));
panel.Controls.Add(new Label() { Text = " Address" }, 0, 0);
panel.Controls.Add(new Label() { Text = " Contact No" }, 1, 0);
panel.Controls.Add(new Label() { Text = " Email ID" }, 2, 0);
for (int i = 0; i <= 8; i++)
{
// For Add New Row (Loop this code for add multiple rows)
panel.RowCount = panel.RowCount + 1;
panel.RowStyles.Add(new RowStyle(SizeType.Absolute, 50F));
panel.Controls.Add(new Label() { Text = "Street, City, State" }, 0, panel.RowCount - 1);
panel.Controls.Add(new Label() { Text = "888888888888" }, 1, panel.RowCount - 1);
panel.Controls.Add(new Label() { Text = "xxxxxxx@gmail.com" }, 2, panel.RowCount - 1);
}
panel.AutoScroll = true;