PrepareEdit事件
If e.Col.Name = "C" Then
if e.row.isnull("A") = false andalso e.row.isnull("B") = false
e.Cancel = True
end if
End If
DataColChanged事件
Select Case e.DataCol.Name
Case "A","B"
If e.DataRow.IsNull("A") orelse e.DataRow.IsNull("B") Then
Else
e.DataRow("C") = e.DataRow("A") & e.DataRow("B")
End If
End Select