Dynamic table

Joined
Oct 12, 2010
Messages
1
Reaction score
0
I want to create a dynamic table


int Hoogte = 7;
int Breedte = 7;
int CenterX = 10;
int CenterY = 10;
int BeginX;
int BeginY;

Double resultX = CenterX - (Breedte / 2);
BeginX = Convert.ToInt32(Math.Ceiling(resultX));

Double resultY = CenterY - (Hoogte / 2);
BeginY = Convert.ToInt32(Math.Ceiling(resultY));

Image Image = new Image();

int TellerX = 0;
int TellerY = 0;


Table TableMap = new Table();

while (TellerY < Hoogte)
{
TableRow TableMapRow = new TableRow();

while (TellerX < Breedte)
{
TableCell TableMapCell = new TableCell();
Image.ImageUrl = "/images/normal.jpg";

//TableMapCell.Text = "Test";
TableMapCell.Controls.Add(Image);
TableMapRow.Cells.Add(TableMapCell);
TellerX++;
}
TableMap.Rows.Add(TableMapRow);
TellerX = 0;
TellerY++;
}

MapPlaceHolder.Controls.Add(TableMap);

But i only get the picture 1 time and in fact i need it 7*7
can somebody help me?
 

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,769
Messages
2,569,580
Members
45,055
Latest member
SlimSparkKetoACVReview

Latest Threads

Top