Just trying to turn the text of a row in my datagrid different colour

g_r_a_robinson

Well-known member
Joined
Jan 13, 2004
Messages
71
All I want to do is have the row text in my datagrid changed to a different colour when one of the statements are met.

I just dont know how to reference my row. Heres my code:

<code>
private void C1WebGrid1_ItemDataBound(object sender, C1.Web.C1WebGrid.C1ItemEventArgs e)
{
C1ListItemType lit = e.Item.ItemType;
String jobDueByDate;
DateTime TodaysDate = System.DateTime.Now;

if (lit == C1ListItemType.Item || lit == C1ListItemType.AlternatingItem)
{
DataRowView drv = (DataRowView) e.Item.DataItem;
jobDueByDate = drv[JobData.DUE_DATE_FIELD].ToString();

DateTime tmpDate = Convert.ToDateTime(jobDueByDate);

if (TodaysDate == tmpDate) // This job is to be done today
{
// Turn row text blue here }

if (TodaysDate > tmpDate) // This job is overdue
{
// Turn row text red here }

}
}


</code>
 
Back
Top