473,487 Members | 2,461 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

TableRow/TableCell Serverside Q

Consider this pseudo HTML from a web form

<asp:Table>
<asp:TableRow>
<asp:TableCell>
<asp:Table>
<asp:TableRow>
<asp:TableCell></asp:TableCell>
<asp:TableCell></asp:TableCell>
</asp:TableRow>
</asp:Table>
</asp:TableCell>
</asp:TableRow>
</asp:Table>

How can I construct this on the server side? Assume that I start with an
empty asp:table control on my webform, as follows:

<asp:Table ID="tblViewWall" Runat="server"></asp:Table>

I've done the following:

TableRow trRow = new TableRow();
TableCell trCell = new TableCell();
trRow.Cells.Add(trCell);

// Now inside trCell, I want to add another table with 1 row, and two
cells
// I can't see how I would create another Table, and add it to a
TableCell

tblViewWall.Rows.Add(trRow);
Nov 17 '05 #1
2 1978
Figured it out.
tcCell.Controls.Add( ...)
"George Durzi" <gd****@hotmail.com> wrote in message
news:#t**************@TK2MSFTNGP09.phx.gbl...
Consider this pseudo HTML from a web form

<asp:Table>
<asp:TableRow>
<asp:TableCell>
<asp:Table>
<asp:TableRow>
<asp:TableCell></asp:TableCell>
<asp:TableCell></asp:TableCell>
</asp:TableRow>
</asp:Table>
</asp:TableCell>
</asp:TableRow>
</asp:Table>

How can I construct this on the server side? Assume that I start with an
empty asp:table control on my webform, as follows:

<asp:Table ID="tblViewWall" Runat="server"></asp:Table>

I've done the following:

TableRow trRow = new TableRow();
TableCell trCell = new TableCell();
trRow.Cells.Add(trCell);

// Now inside trCell, I want to add another table with 1 row, and two
cells
// I can't see how I would create another Table, and add it to a
TableCell

tblViewWall.Rows.Add(trRow);

Nov 17 '05 #2
George,

Try something like this:

TableCell newCell = new TableCell();
Table childTable = new Table();
newCell.Controls.Add(childTable);

//Populate the child table here.

TableRow newRow = new TableRow();
newRow.Cells.Add(newCell);

this.tblViewWall.Rows.Add(newRow);
HTH,
Nicole

"George Durzi" <gd****@hotmail.com> wrote in message
news:%2****************@TK2MSFTNGP09.phx.gbl...
Consider this pseudo HTML from a web form

<asp:Table>
<asp:TableRow>
<asp:TableCell>
<asp:Table>
<asp:TableRow>
<asp:TableCell></asp:TableCell>
<asp:TableCell></asp:TableCell>
</asp:TableRow>
</asp:Table>
</asp:TableCell>
</asp:TableRow>
</asp:Table>

How can I construct this on the server side? Assume that I start with an
empty asp:table control on my webform, as follows:

<asp:Table ID="tblViewWall" Runat="server"></asp:Table>

I've done the following:

TableRow trRow = new TableRow();
TableCell trCell = new TableCell();
trRow.Cells.Add(trCell);

// Now inside trCell, I want to add another table with 1 row, and two
cells
// I can't see how I would create another Table, and add it to a
TableCell

tblViewWall.Rows.Add(trRow);

Nov 17 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
3301
by: Rajeev | last post by:
Hi I can use the TableRow and TableCell class in C# while using Web forms. The same are not available while programming with Windows Forms. I have the folloowing code that works fine with Web...
0
3390
by: Randy | last post by:
Hello All, Is there any way to make this happen... Say I want to make a table with 3 rows. The first row has two TableCells each with a width of 300. The second row has one TableCell with the...
4
5388
by: Serdar Kalaycý | last post by:
I create a TableCell by TableCell cell = new TableCell() but I could not find how to add a TextBox inside this cell. Any ideas? Thanks in advance Serdar KALAYCI --
2
1768
by: Coleen | last post by:
Hi all :-) I have the following code, and need it to break specifically at a point in the span, but I am unable to get it to break exactly where I want it to. <asp:TableCell CssClass="table"...
3
2207
by: RobertH | last post by:
Hello all. I have been hacking away trying to get a SQL image (jpeg) to render in a control or table row Without using the Response.BinaryWrite.... I think i might be on the verge but need a...
6
2615
by: hb | last post by:
Hi, I have a page bill.aspx and its code-behind bill.aspx.cs. On bill.aspx I have: === Select a month: <asp:dropdownlist runat="server" id="lstDate" autopostback="True" /> <br> <asp:table...
1
1335
by: Harry | last post by:
Dear All, I would like to know whether it is possible to add a table in tablerow? Dim Table1 As New Table. Dim Row1 As New TableRow Dim Table2 As New Table Row1.Cells.Add(Table2) ...
2
2625
by: Amelyan | last post by:
If I have spaces in my Text property of Label, and I add it to TableCell, it wraps at spaces. E.g. Label lb = new Label(); lb.Text = "Hello, World!" TableCell cell = new TableCell();...
0
890
by: DanG | last post by:
During grid field validation, I would like to generate a message for the user to tell which column had the error. So I have a control (textbox, dropdownlist, checkbox, etc.), and would like to...
0
7142
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
7181
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
1
6847
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
7352
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
1
4875
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
4565
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
3078
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
3071
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
618
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.