server side tables

Discussion in 'ASP.NET / ASP.NET Core' started by TonyMast, Oct 23, 2004.

Thread Status:
Threads that have been inactive for 5 years or longer are closed to further replies. Please start a new thread.
  1. I'm getting some weird results using server side tables.

    Can Controls be added to server tables at design time?

    How can I make the cells staic in size I set them? (Not autosizing)

    Why when I use table.rows(2).cell(1).controls.remove(label1), this removes all controls from the table?

    Thanks
    Tony



    Thank you
    Tony
     
  2. Hi, have you try to use System.Web.UI.WebControls.Table?
    I used it to generate public forum on my website, and it works great.
    here is the example...

    //Fill in dynamic Table contents here.

    //Create Row1
    TableRow r = new TableRow();
    r.BackColor = Color.AntiqueWhite;
    TableCell c = new TableCell();
    c.Controls.Add(new LiteralControl("Message ID: " + id ));
    r.Cells.Add(c);
    TableCell c2 = new TableCell();
    c2.Controls.Add(new LiteralControl("From: " + alias));
    r.Cells.Add(c2);
    mytable2.Rows.Add(r);

    //Create Row 2
    TableRow r2 = new TableRow();
    r2.BackColor = Color.AliceBlue;
    TableCell c3 = new TableCell();
    c3.Controls.Add(new LiteralControl("Date: " + date));
    r2.Cells.Add(c3);
    TableCell c4 = new TableCell();
    c4.Controls.Add(new LiteralControl("Time: " + time));
    r2.Cells.Add(c4);
    mytable2.Rows.Add(r2);

    //Create Row 3 - Created a listbox control, and insert the control into the tablecell.
    TableRow r3 = new TableRow();
    TableCell c5 = new TableCell();

    TextBox t1 = new TextBox();
    t1.Text = content;
    t1.TextMode = TextBoxMode.MultiLine;
    t1.Width = 744;
    t1.Height = 199;
    t1.ReadOnly = true;
    c5.Controls.Add(t1);
    c5.ColumnSpan = 2;
    r3.Cells.Add(c5);
    mytable2.Rows.Add(r3);


    hope this helps. ^^


    Tommy
     
Thread Status:
Threads that have been inactive for 5 years or longer are closed to further replies. Please start a new thread.

Share This Page