沥青混合料试验结果表DataColChanging事件
If e.DataCol.Name.StartsWith("筛孔") Then
Dim dr As DataRow = DataTables("范围").Find("品种='" & e.DataRow("品种") & "'")
If dr IsNot Nothing Then
If dr.IsNull(e.DataCol.Name) Then
e.Cancel = True
Else
Dim v() As String = dr(e.DataCol.Name).split("~")
Dim v1 As Decimal = val(e.NewValue)
If v.Length = 2 Then
If v1 < val(v(0)) AndAlso v1 > val(v(1)) Then
msgbox("范围应该在:" & dr(e.DataCol.Name))
e.Cancel = True
End If
Else
If v1 <> val(v(0)) Then
msgbox("范围应该在:" & dr(e.DataCol.Name))
e.Cancel = True
End If
End If
End If
End If
End If