Finally I have to do away with TableLayoutPanel and switch to Panel ;most obvious reason was that my user controls have varying height and which created messy layout.
I added my instances of user controls into panel at a location and next instances were added after previous instance.I also did the logic for recreating user controls instance in case a instance is disposed from the panel
int heightofGP = 0; int nextloc = 0; bool forFirst = true;
ucPanel pnl = new ucPanel();
pnl.Anchor = AnchorStyles.Top | AnchorStyles.Left | AnchorStyles.Right;
pnl.AutoScroll = true;
pnl.BorderStyle = BorderStyle.None;
pnl.Name = string.Format("{0}", market.marketId);
pnl.Margin = new Padding(0, 10, 0, 0);
heightofGP = pnl.Height;
if (forFirst)
{
pnl.Location = new Point(0, 0);
forFirst = false;
}
else
{
pnl.Location = new Point(0, nextloc);
}
nextloc = nextloc + heightofGP + 5;
pnlRunner.Controls.Add(pnl);