I am having a problem with a nested TableCell object putting all of the data in the last page when it should be distributing it. Is there something I have to do beyond creating a new instance?
i.e. TableRow page = new TableRow()
int page_id = 1;
int row_id = 1;
TableCell pagecell = new TableCell();
Table pagetable = new Table();
Table control = new Table();
while ( foo.Read( )) {
TableCell accountcell = new TableCell();
TableRow accountrow = new TableRow();
accountrow.Controls.Add(accountcell );
pagetable.Controls.Add(accountrow );
if (row_id > 9 || (page_id == 1 && row_id == 1)) {
pagecell = new TableCell();
pagecell.Controls.Add(pagetable );
TableRow page = new TableRow();
page.Controls.Add(pagecell );
control.Controls.Add(page );
if (row_id > 9) {
row_id = 1;
++page_id;
}
} else {
pagecell.Controls.Add(pagetable );
}
++row_id;
}
i.e. TableRow page = new TableRow()
int page_id = 1;
int row_id = 1;
TableCell pagecell = new TableCell();
Table pagetable = new Table();
Table control = new Table();
while ( foo.Read( )) {
TableCell accountcell = new TableCell();
TableRow accountrow = new TableRow();
accountrow.Controls.Add(accountcell );
pagetable.Controls.Add(accountrow );
if (row_id > 9 || (page_id == 1 && row_id == 1)) {
pagecell = new TableCell();
pagecell.Controls.Add(pagetable );
TableRow page = new TableRow();
page.Controls.Add(pagecell );
control.Controls.Add(page );
if (row_id > 9) {
row_id = 1;
++page_id;
}
} else {
pagecell.Controls.Add(pagetable );
}
++row_id;
}