01.
Protected
Sub
GridView1_RowDataBound(
ByVal
sender
As
Object
,
ByVal
e
As
System.Web.UI.WebControls.GridViewRowEventArgs)
Handles
GridView1.RowDataBound
02.
If
e.Row.RowType = DataControlRowType.DataRow
Then
03.
Dim
strStatus
As
String
=
String
.Empty
04.
Dim
datetest
As
Date
= e.Row.Cells(3).Text
05.
datetest =
CDate
(
CStr
(Format(datetest,
"dd/MM/yyyy"
)))
06.
07.
Dim
datetest1
As
Date
= Now
08.
datetest1 =
CDate
(
CStr
(Format(datetest1,
"dd/MM/yyyy"
)))
09.
10.
11.
If
DateDiff(DateInterval.Day,
CDate
(datetest),
CDate
(datetest1)) >= 30
Then
12.
e.Row.Cells(0).ForeColor = Drawing.Color.Red
13.
e.Row.Cells(1).ForeColor = Drawing.Color.Red
14.
e.Row.Cells(2).ForeColor = Drawing.Color.Red
15.
e.Row.Cells(3).ForeColor = Drawing.Color.Red
16.
e.Row.Cells(4).ForeColor = Drawing.Color.Red
17.
Else
18.
19.
End
If
20.
21.
End
If
22.
End
Sub