datacolchanged事件
Select Case e.DataCol.Name
Case "PType"
Dim rrrr As DataRow = e.DataRow
If rrrr ("PType") <> "采购单价" AndAlso rrrrr ("PType") <> "订单委外单价"
rrrrr ("FPType") = 9
Else
If rrrrr ("PType") ="采购单价"
rrrrr ("FPType") = 1
Else
rrrrr ("FPType") = 0
End If
End If
Case "PartNo"
If e.DataRow.IsNull("PartNo") Then
e.DataRow("FItemID") = 0
Else
Dim rr As DataRow = e.DataRow
Dim cmd As new SQLCommand
cmd.CommandText = "Se lect Fname,FItemID From {t_ICItemCore} Where FNumber = '" & rr("PartNo") & "'"
cmd.C
Dim Values = cmd.ExecuteValues
If Values.Count > 0 Then
rr("FItemID") = Values("FItemID")
Else
rr("FItemID") = 0
End If
End If
End Select