The itemDataBound event will only have reference to a particular row in your grid so unless the total salary of all employees exist in all rows, you wont have access to that information. Something like this is how you would loop through the items:
if (e.Item.ItemType == ListItemType.Item || e.Item.ItemType == ListItemType.AlternatingItem || e.Item.ItemType == ListItemType.EditItem)
{
DataRowView rv = (DataRowView)e.Item.DataItem;
DateTime dt = Convert.ToDateTime(rv.Row.ItemArray[0]);
if (DateTime.Compare(DateTime.Now, dt) > 0)
{
for(int i=0; i < e.Item.Cells.Count; i++)
{
e.Item.Cells[i].CssClass = "cssclass";
}
}
}
This code grabs an element that appears in element 0 (presumably a date) and checks to see if the value comes before todays date, if it has it loops through all the cells in the grid of that row and applies a style to it. Conceiveably this style could turn the column a certain color.
hth.
================================================== =========
Read this if you want to know how to get a correct reply for your question:
http://www.catb.org/~esr/faqs/smart-questions.html
================================================== =========
Technical Editor for:
Professional Search Engine Optimization with ASP.NET
Professional IIS 7 and ASP.NET Integrated Programming
================================================== =========