The problem seems caused by the follwing insertion of rowstyles. When a new row was added, only a new row style was added, makie the total rowstyles to 3. Whilethe total row count still the same as before adding a new row, that's 2.
this
.tableLayoutPanel1.RowCount = 2; //Still two rows!!!!
this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 74F));
this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 22F));
this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 20F)); //A new rowstyle was added.
My problem is hosting this tableLayoutPanel on the custom designer. Seems I cannot hook up the on controladded event to change the rowcount. How should I approach this issue, please kindly advise.
Thanks for your time and expertise.
Alan