gridview

  • Thread starter Thread starter Roger
  • Start date Start date
R

Roger

Hi All

hope you can help here

Is it possiable to change the colour of a row in a gridview depending on the
content of one cell ?

Hope that makes sense

Happy New year to all

Roger
 
You can do it in either RowDataBound or PreRender event:

protected void allGrids_OnRowDataBound(Object sender,
System.Web.UI.WebControls.GridViewRowEventArgs e)
{
if (e.Row.RowType == DataControlRowType.DataRow)
{
System.Web.UI.WebControls.TableCell cell =
e.Row.Cells[myIndex];
if (check something for cell)
{
e.Row.(set properties as needed)
}
}
}


--
Eliyahu Goldin,
Software Developer
Microsoft MVP [ASP.NET]
http://msmvps.com/blogs/egoldin
http://usableasp.net
 
Back
Top