Click to See Complete Forum and Search --> : adding a merged row to a table (code-side)


dazi_behappy
10-25-2006, 06:08 PM
Hello all, im creating a table code-side:


Table testtable = new Table();
TableRow row = new TableRow();

//HEADINGS
TableCell cell = new TableCell();
cell.Text = "<b>Show Alerts</b>";
row.Cells.Add(cell);

cell = new TableCell();
cell.Text = "<b>Client</b>";
row.Cells.Add(cell);

cell = new TableCell();
cell.Text = "<b>Status</b>";
row.Cells.Add(cell);

testtable.Rows.Add(row);

TableRow row2 = new TableRow();

//ADD SHOW ALERT BUTTON
TableCell tablecell = new TableCell();

ImageButton button = new ImageButton();
button.Click += new ImageClickEventHandler(ImageButton1_Click);
tablecell.Controls.Add(button);
row2.Cells.Add(tablecell);

//ADD Client cell
tablecell = new TableCell();
tablecell.Text = "<a href='ClientHomePage.aspx'>Client</a>";
row2.Cells.Add(tablecell);

//ADD Status Cell
tablecell = new TableCell();
tablecell.Text = "Status";
row2.Cells.Add(tablecell);

testtable.Rows.Add(row2);

Panel1.Controls.Clear();
Panel1.Controls.Add(testtable);


How can I go about adding a new row, but I dont want the row to have 3 columns, I would like there to be only 1 column (i.e. merge the three columns in the row). How would I go about achiving this code-side?