datacolchanged事件
Dim cs() As String = {"收取", "摆放"}
If array.IndexOf(cs, e.DataCol.Name) > -1 Then
If e.NewValue = True Then
Dim fdr As DataRow = DataTables("表B").Find("型号 = '" & e.DataRow("型号") & "'")
If fdr IsNot Nothing Then
e.DataRow("能力") = fdr(e.DataCol.Name)
Else
e.DataRow("能力") = Nothing
End If
Else
Dim cname As String = ""
For Each c As String In cs
If e.DataRow(c) = True Then
cname = c
Exit For
End If
Next
If cname = "" Then
e.DataRow("能力") = Nothing
Else
Dim fdr As DataRow = DataTables("表B").Find("型号 = '" & e.DataRow("型号") & "'")
If fdr IsNot Nothing Then
e.DataRow("能力") = fdr(cname)
Else
e.DataRow("能力") = Nothing
End If
End If
End If
Else If e.DataCol.Name = "型号" Then
Dim cname As String = ""
For Each c As String In cs
If e.DataRow(c) = True Then
cname = c
Exit For
End If
Next
If cname = "" Then
e.DataRow("能力") = Nothing
Else
Dim fdr As DataRow = DataTables("表B").Find("型号 = '" & e.DataRow("型号") & "'")
If fdr IsNot Nothing Then
e.DataRow("能力") = fdr(cname)
Else
e.DataRow("能力") = Nothing
End If
End If
End If