Add Image to Table Control

G

Garth Wells

Using C#...have any code that shows how to
programattically add an image to a cell of a
table server control?

Thanks
 
G

Guest

Garth - how about something along the lines of

=-=-=-=-=-
// Generate rows and cells.
int numrows = 3;
int numcells = 2;

for (int j=0; j<numrows; j++)
{
TableRow r = new TableRow();
for (int i=0; i<numcells; i++)
&nbsp{
&nbspTableCell c = new TableCell();
&nbspSystem.Web.UI.WebControls.Image image = new
System.Web.UI.WebControls.Image();
&nbspimage.ImageUrl = "images/picture.jpg";
&nbspc.Controls.Add(image);
&nbspr.Cells.Add(c);
&nbsp}
Table1.Rows.Add(r);
}

=-=-=-=-=-=-
brians
www.limbertech.com
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,744
Messages
2,569,484
Members
44,903
Latest member
orderPeak8CBDGummies

Latest Threads

Top