Blah. I hate when the answer to a question is apparent and I over look it. If you need to do conditional formatting to a datagrid, handle the ItemDataBound or ItemCreated event.
Your solution might look something like this:
Code:
private void dg_ItemDataBound(object sender, System.Web.UI.WebControls.DataGridItemEventArgs e)
{
if (e.Item.ItemType == ListItemType.Item || e.Item.ItemType == ListItemType.AlternatingItem)
{
DataRowView rv = (DataRowView)e.Item.DataItem;
DateTime dt = Convert.ToDateTime(rv.Row.ItemArray[8]);
if (DateTime.Compare(DateTime.Now, dt) > 0)
{
for(int i=0; i < e.Item.Cells.Count; i++)
{
e.Item.Cells[i].CssClass = "lapsedText";
}
}
}
}
================================================== =========
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
^^Took that from planoie's profile^^
^^Modified text taken from gbianchi profile^^
================================================== =========
Technical Editor for:
Professional Search Engine Optimization with ASP.NET
http://www.wiley.com/WileyCDA/WileyT...470131470.html
================================================== =========
Why can't Programmers, program??
http://www.codinghorror.com/blog/archives/000781.html
================================================== =========