DataColChanged事件
If e.DataCol.Name = "宽度" Then
If e.DataRow.IsNull("宽度") Then
e.DataRow("箱长") = Nothing
Else
Dim fdr As DataRow = DataTables("工艺规程").Find("宽度MIN <= " & e.DataRow("宽度") & " and 宽度MAX >= " & e.DataRow("宽度"))
If fdr IsNot Nothing Then
msgbox(fdr("公式"))
e.DataRow("箱长") = eval(fdr("公式").replace("L", e.DataRow("宽度")))
Else
e.DataRow("箱长") = Nothing
End If
End If
End If