I have a gridview and i want to insert inside a cell a Panel in which inside i want to render html tags. Instead i see in the text the html tags. Any ideas?.
protected void grdThreat_RowDataBound(object sender, GridViewRowEventArgs e)
{
if (e.Row.RowType == DataControlRowType.DataRow)
{
Panel mainPanel = new Panel();
mainPanel.Controls.Add(new LiteralControl(e.Row.Cells[4].Text));
e.Row.Cells[4].Controls.Add(mainPanel);
}
}

Modify the Text property of the cell and then it should work. Currently it is just pasting as text.
also see How to render decoded HTML in a (i.e. a <br>) in GridView cell