Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations derfloh on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Adding a Panel to a table row

Status
Not open for further replies.

wrexhamafc234

Programmer
Oct 23, 2006
18
GB
Hi all, im creating a table code-side

Code:
Table clienttable = 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);

        clienttable.Rows.Add(row);

        TableRow row2 = new TableRow();

        //HEADINGS
        Panel Panel1 = new Panel();
        row2.Controls.Add(Panel1);

        clienttable.Rows.Add(row2);

This table is being added to a Panel in the page_load event.

I want the second row in this table to only have 1 colum (i.e. all the 4 columns are merged) and to include a Panel.

When running this code, im getting an error:
'TableRow' cannot have children of type 'Panel'.
Is this not possible at all, or is there anythin else I can use instead of a panel that will work?
 
"Code-side"? Is that server-side code, or client-side code?

Where are the Table, TableRow, and TableCell objects defined?

What methods / properties do they have? Is there one that lets you specify the spanning?

What you've provided may look like JS, but without knowing anything about the objects you're using (which don't come "as standard" AFAIK), not much advice can be given.

Hope this helps,
Dan



Coedit Limited - Delivering standards compliant, accessible web solutions

[tt]Dan's Page [blue]@[/blue] Code Couch
[/tt]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top