禁止编辑不起作用是
Select Case e.DataCol.Name
Case "发货确认"
Dim dt As DataTable = DataTables("产品表")
Dim drs As List(Of DataRow) '定义一个DataRow集合.
drs = dt.Select("编码 = '" & e.DataRow("编码") & "'and 批次 = '" & e.DataRow("批次") & "'")
If drs.Count = 0 Then
If e.DataCol.Name = "发货确认" Then '如果修改的是标注列
MessageBox.Show("无相关产品")
e.Cancel = True '那么禁止编辑
End If
End If
e.DataRow.Save()
End Select
<!--EndFragment-->