Create a table dynamically
Table submitTable
= new Table();
Create a row(tr) dynamically
TableRow row = new TableRow();
Create a cell(td) dynamically
TableCell cell = new TableCell();
Add a button in a cell :
cell.Controls.Add(this.BuildTestButton());
Add cell in a row :
row.Cells.Add(cell);
Add row in a table :
submitTable.Rows.Add(row);
protected virtual Button BuildTestButton()
{
Button
button = new Button();
button.Width = 120;
button.Text = "Test";
button.Click += new EventHandler(this.OnTestButtonClick);
return
button;
}
{
//do
your code here.
}

Dhayalan SwamyPosted Aug 15, 2018, 4:25 AM
Can we implement formula for the table cell to caluculate some math like + - / % average
Sujeet SumanPosted Oct 14, 2015, 6:14 AM
Nice Article.................
Dawood AbbasPosted May 28, 2015, 5:32 AM
how to add multiple controls like (dropdown,checkbox,textbox) in one row one add button click and how to delete it on delete button click which is besides row button.
Nikhil PhadnisPosted Mar 26, 2013, 6:56 AM
Above code is fine but to render the created table you need to bind it with Particular Div.
ali richiPosted Mar 25, 2013, 12:46 AM
which is namespace?