Protected Sub gvcar_all_RowDataBound(ByVal sender As Object, ByVal e As System.Web.UI.WebControls.GridViewRowEventArgs) Handles gvcar_all.RowDataBound
Dim rowID As Integer = e.Row.RowIndex
Dim dLastDate As Date
Dim test As String = ""
If rowID >= 0 Then
test = e.Row.Cells(1).Text.Trim
If e.Row.Cells(5).Text.Trim <> "" Then
dLastDate = CDate(e.Row.Cells(5).Text)
If Date.Now <= dLastDate.AddMonths(6) Then
e.Row.BackColor = Drawing.Color.Orange
Else
e.Row.BackColor = Drawing.Color.Green
End If
Else
e.Row.BackColor = Drawing.Color.Blue
End If
End If
End Sub
Tag : .NET, Ms SQL Server 2008, JavaScript, Web (ASP.NET), VS 2008 (.NET 3.x)