DataColChanged事件
Select Case e.DataCol.name
Case "年", "月", "资格"
If e.DataRow.isnull("年") OrElse e.DataRow.isnull("月") OrElse e.DataRow.isnull("资格") Then
e.DataRow("开始日期") = Nothing
Else
If e.DataRow("资格") = "小规模纳税人" Then
Dim d As Date = new Date(e.DataRow("年"), e.DataRow("月"), 1)
e.DataRow("开始日期") = d.AddMonths(-2)
ElseIf e.DataRow("资格") = "一般纳税人" Then
e.DataRow("开始日期") = new Date(e.DataRow("年"), e.DataRow("月"), 1)
Else
e.DataRow("开始日期") = Nothing
End If
End If
End Select
[此贴子已经被作者于2017/10/6 11:26:37编辑过]