S
Sujay Ghosh
Hi,
I am programmatically creating a TableLayout panel with 8 columns and 21
rows .
Within the cell I am placing some labels and checkboxes .
Then I dynamically add more rows , by calling my function UpdateTable( ).
private TableLayoutPanel tb = new TableLayoutPanel ().
private void UpdateTable( )
{
tb.SuspendLayout() ;
tb.GrowStyle = TableLayoutPanelGrowStyle.AddRows;
// assume LastRowCount = 21 , as I have added 21 rows earlier
// hence I increment LastRowCount in the for loop initialization
for( int i = LastRowCount+1 ; i< 20 ; i++
tb.RowStyles.Add( myRowStyle );
tb.ResumeLayout(false );
}
Strangely enough the following things happen
1) Calling UpdateTable() for the first time - Only one row gets added ;
2) Calling UpdateTable () for the second time - The checkboxes are getting
redrawn in DIFFERENT positions ... which is not desired .
For the second one, I think pending layouts are getting performed intenally
by the layout engine ...
Can anyone help me in getting answers to these problems .
Thanks in advance ,
Sujay
I am programmatically creating a TableLayout panel with 8 columns and 21
rows .
Within the cell I am placing some labels and checkboxes .
Then I dynamically add more rows , by calling my function UpdateTable( ).
private TableLayoutPanel tb = new TableLayoutPanel ().
private void UpdateTable( )
{
tb.SuspendLayout() ;
tb.GrowStyle = TableLayoutPanelGrowStyle.AddRows;
// assume LastRowCount = 21 , as I have added 21 rows earlier
// hence I increment LastRowCount in the for loop initialization
for( int i = LastRowCount+1 ; i< 20 ; i++
tb.RowStyles.Add( myRowStyle );
tb.ResumeLayout(false );
}
Strangely enough the following things happen
1) Calling UpdateTable() for the first time - Only one row gets added ;
2) Calling UpdateTable () for the second time - The checkboxes are getting
redrawn in DIFFERENT positions ... which is not desired .
For the second one, I think pending layouts are getting performed intenally
by the layout engine ...
Can anyone help me in getting answers to these problems .
Thanks in advance ,
Sujay