I have built a gridview that includes one bound column on the far left and every other column is a template column that contains an html table. I do this because I need to organize 6 pieces of info neatly into each cell. However, in some cases the data that is populating these template column-html tables is null. When this is the case, these cells only display the empty frame of the html table. I would like to make the html table disappear entirely when it is not populated with data. Does anyone know how I would go about doing it? I assume I use the onrowcreated or onrowdatabound event handlers, but I don’t know how to identify this table in order to set it to invisible.
Any help is greatly appreciated.
Solutions
<table border="0" cellpadding="0" cellspacing="0" style="boder:none 0px">/<table>Set attribute runat=”server” and id.
<table id="tblThis"runat="server"></table>
In rowdatabound event
if(e.Row.RowType == DataControlRow.DataRow){
var tbl= (Class_Of_HtmlTable)e.Row.FindControl("tblThis");
//Do whatever with table
// tbl.Visible = false;
}