你datacolchanged其它代码有问题,因为你修改其他列值的时候,同样会触发datacolchanged事件
Dim dr As DataRow = e.DataRow
Select Case e.DataCol.Name
Case "物料代码"
Dim vf As String = e.NewValue
Dim dr2 As DataRow = DataTables("即时库存").Find("物料代码 = '" & vf & "'")
Dim dr1 As DataRow = DataTables("物料表").Find("代码 = '" & vf & "'")
systemready = False
If dr1 IsNot Nothing Then
dr("物料名称") = dr1("名称")
dr("物料规格") = dr1("规格型号")
dr("单位") = dr1("单位")
End If
If dr2 IsNot Nothing Then
dr("库存数量") = dr2("基本计量单位数量")
End If
systemready = True
End Select