Insert Div in gridview cell

suzwttefly

New Member
I have a gridview and on RowDatabound event i am trying to insert a div inside the cell and set the innerhtml. On debugging the innerHTML of the div is full of text. But when it is run ii is an empty cell. Any help?\[code\] protected void grdThreat_RowDataBound(object sender, GridViewRowEventArgs e) { if (e.Row.RowType == DataControlRowType.DataRow) { HtmlGenericControl div = new HtmlGenericControl("div"); div.InnerHtml = e.Row.Cells[4].Text; e.Row.Cells[4].Controls.Add(div); }}\[/code\]
 
Back
Top