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?
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?