回复8楼,大概如下
For i As Integer = 1 To 4
Select Case e.DataCol.Name
Case "创建日期" & i,"处理日期" & i
Dim dt1 As Date = e.DataRow("创建日期" & i)
If e.DataRow.Isnull("创建日期" & i) Then
e.DataRow("状态" & i) = ""
Else
Dim dt2 As Date
If e.DataRow.Isnull("处理日期" & i) Then
dt2 = Date.Today
Else
dt2= e.DataRow("处理日期" & i)
End If
Dim tp As TimeSpan = dt2- dt1
e.DataRow("状态" & i) = tp.TotalDays
End If
End Select
Next