帮助中:"例如年龄列由出生日期计算得出,我们将DataColChanged事件设为:
If
DataCol.Name = "出生日期" Then
If e.DataRow.IsNull("出生日期") Then '如果没有输入出生日期
e.DataRow("年龄") = Nothing '则清空年龄
Else
'否则计算年龄
e.DataRow("年龄") = Date.Today.Year - e.DataRow("出生日期").Year
End If
End If "
错误: If DataCol.Name = "出生日期" Then
正确: If e.DataCol.Name = "出生日期" Then