在这个for循中 如何动态数据到2行后不能再纵向,然后就横向的加行?
for (int I = 0; I <= DS.Tables[ "name "].Rows.Count - 1; I++)
{
TabRow = new TableRow();
TabCell = new TableCell();
CheckBox myCheckBox = new CheckBox();
myCheckBox.Text = DS.Tables[ "name "].Rows[I][ "id "].ToString();
TabCell.Controls.Add(myCheckBox);
TabRow.Cells.Add(TabCell);
TabCell = new TableCell();
TabCell.Text = DS.Tables[ "name "].Rows[I][ "pname "].ToString();
TabRow.Cells.Add(TabCell);
myTable.Rows.Add(TabRow);
myTable.Rows.Add(TabRow);
}
[解决办法]
Up