datacolchanging事件
Select Case e.DataCol.Name
Case "开始时间","结束时间"
If e.DataRow.IsNull("开始时间") OrElse e.DataRow.IsNull("结束时间")
Else
If e.DataRow("开始时间") >= e.DataRow("结束时间") Then
msgbox("结束时间必须大于开始时间")
e.Cancel = True
End If
End If
If e.DataCol.Name = "开始时间" Then
Dim dr As DataRow = e.DataTable.Find("[_Identify] < " & e.DataRow("_Identify"),"[_Identify] desc")
If dr IsNot Nothing Then
If e.DataRow("开始时间") <= dr("结束时间") Then
msgbox("开始时间必须大于上一行结束时间")
e.Cancel = True
End If
End If
End If
End Select