I have a secondary form with a docked FlowLayoutPanel that is dynamically populated with a number of DataGridViews. When there are a large number, around 100 or more, the vertical scroll will not display all the child controls. Sometimes they are cut off mid control. If I resize the window it will change the number of controls and how much of the last row of controls will be displayed, but not in any pattern I can recognize. When I maximize the form it is very likely to display all the child controls, but not guaranteed.
The closest I've found to this problem has recommended using SyspendLayout/ResumeLayout around the addition of the controls, but this has done nothing for me.
private void PopulateDisplay()
{
previewFlow.SuspendLayout();
foreach(DataGridView dgv in _Display)
{
previewFlow.Controls.Add(dgv);
}
previewFlow.ResumeLayout();
}
_Display is List which I populate earlier via code. Each is populated by a SQL query that returns a different number of results.
I would like the form to show all the DataGridViews on any size form without having to worry that something is incomplete.