I trying to change a cell in my gridview based on a past due date. So anything that's greater then "Today" would get highlited. can't seem to get it to work. any help would be appreciated
Protected Sub dg1_RowDataBound(ByVal sender As Object, ByVal e As GridViewRowEventArgs)
Dim currDate As DateTime = Convert.ToDateTime(DateTime.Now.ToString("{0:d}"))
If e.Row.RowType = DataControlRowType.DataRow Then
If Convert.ToDateTime(DataBinder.Eval(e.Row.DataItem, "DUE_DATE").ToString()) < currDate Then
e.Row.Cells(0).BackColor = System.Drawing.Color.Yellow
End If
End If
End Sub
Protected Sub dg1_RowDataBound(ByVal sender As Object, ByVal e As GridViewRowEventArgs)
Dim currDate As DateTime = Convert.ToDateTime(DateTime.Now.ToString("{0:d}"))
If e.Row.RowType = DataControlRowType.DataRow Then
If Convert.ToDateTime(DataBinder.Eval(e.Row.DataItem, "DUE_DATE").ToString()) < currDate Then
e.Row.Cells(0).BackColor = System.Drawing.Color.Yellow
End If
End If
End Sub