我们可以在该表的DataColChanged事件中加入下面的代码:
If e.DataCol.Name = "起始日期"
OrElse e.DataCol.Name = "执行天数"
Then
If e.DataRow.IsNull("起始日期")
OrElse e.DataRow.IsNull("执行天数") Then
e.DataRow("完成日期")
= Nothing
Else
e.DataRow("完成日期")
= e.DataRow("起始日期").AddDays(e.DataRow("执行天数"))
End
If
End
If
如何将执行天数变成年和月来计算保质期?