Dynamic table in Asp.Net
Posted
by Sivakumar
on Stack Overflow
See other posts from Stack Overflow
or by Sivakumar
Published on 2010-05-09T13:49:50Z
Indexed on
2010/05/09
15:18 UTC
Read the original article
Hit count: 257
Hi guys here I've created d dynamic table and how can i set d properties of the table like height, width and etc? Pls help me.. Thanks...
code
private void GenerateTable(int rowsCount)
{
Table table = new Table();
for (int i = 0; i < rowsCount; i++)
{
TableRow row = new TableRow();
TableCell cell = new TableCell();
TextBox tb1 = new TextBox();
DropDownList drp1 = new DropDownList();
tb1.ID= "dname"+i;drp1.ID = "relation" + i;
cell.Controls.Add(tb1);
cell.Controls.Add(drp1);
row.Cells.Add(cell);table.Rows.Add(row);
}
rowsCount++;
ViewState["RowsCount"] = rowsCount;
}
© Stack Overflow or respective owner