DataColChanged事件
'If e.DataRow.IsNull("应发工资公式") Then
'e.DataRow("应发工资") = Nothing
'Else
'e.DataRow("应发工资") = Eval2(e.DataRow("应发工资公式"),e.DataRow)
'End If
'
If e.DataRow.IsNull("应发工资公式") Then
e.DataRow("应发工资") = Nothing
Else
Dim str As String = e.DataRow("应发工资公式")
For Each dc As DataCol In e.DataTable.DataCols
str = str.replace("[" & dc.name & "]", dc.name).Replace(dc.name, "[" & dc.name & "]")
Next
If TryEval(str, e.DataRow) Then
e.DataRow("应发工资") = Eval2(str,e.DataRow)
Else
msgbox("公式错误")
End If
End If