老师,怎么可以把这段代码放到daterowadded 呀? 感谢 感谢
If e.DataCol.Name = "事件编号" Then
Dim dr As DataRow
dr = e.DataTable.Find("事件编号 = '" & e.NewValue & "'")
If dr IsNot Nothing Then
Select Case e.DataCol.Name
Case "事件编号","进行_开始日期"
If e.DataRow.IsNull("事件编号") OrElse e.DataRow.IsNull("进行_开始日期")
Else
Dim d As Date = e.DataTable.Compute("min(进行_开始日期)","事件编号 = '" & e.DataRow("事件编号") & "' and _Identify<>" & e.DataRow.IsNull("_Identify"))
If d <> Nothing Then
Dim tp As TimeSpan = cdate(e.DataRow("进行_开始日期")) - d
e.DataRow("进行_用天") = tp.TotalDays
End If
End If
End Select
'e.Cancel = True
Else
e.DataRow("进行_用天")="0"
End If
End If
[此贴子已经被作者于2019/12/2 20:40:09编辑过]