how to detect grid view empty cell
- by nCdy
how to detect grid view empty cell ? I need it for highlighting. So I made a css
.RedColored
{
background: FF0000;
}
and trying to appear it to empty GV cells this way :
protected virtual GridView1_RowDataBound (_sender : object, e : System.Web.UI.WebControls.GridViewRowEventArgs) : void
{
e.Row.Cells[0].CssClass = "wide";
foreach(i : int in [0..e.Row.Cells.Count-1])
{
when(e.Row.Cells[i].Text==null)
{
e.Row.Cells[i].CssClass="RedColored";
}
}
}
but my it doesn't appears to empty cells , even I've tried
Text=="" , Cell[i]==null, Cell[i].ToString()=="" and nothing helped.