wrexhamafc234
Programmer
Hello, im creating a datatable and in one of the columns, i woul like to add a control (image).
When I try to add the image into the datatable (as shown above), all that is outputted into the table is the following: 'System.Web.UI.WebControls.Image'
Any way of actually adding a control to a datatable?
Code:
DataTable alerttable = new DataTable("alerttable");
alerttable.Columns.Add("Priority");
if ((string)Priority == "High")
{
Priority = "<img src='./images/priority/high.gif' border=0>";
image.ImageUrl = "./images/priority/high.gif";
prioritycell.Controls.Add(image);
}
else if ((string)Priority == "Medium")
{
Priority = "<img src='./images/priority/high.gif' border=0>";
image.ImageUrl = "./images/priority/medium.gif";
prioritycell.Controls.Add(image);
}
else if ((string)Priority == "Low")
{
Priority = "<img src='./images/priority/high.gif' border=0>";
image.ImageUrl = "./images/priority/low.gif";
prioritycell.Controls.Add(image);
}
alerttable.Rows.Add(image);
When I try to add the image into the datatable (as shown above), all that is outputted into the table is the following: 'System.Web.UI.WebControls.Image'
Any way of actually adding a control to a datatable?