独占编辑很简单。
1、dataColchanged事件,写代码
e.datarow("编辑者") = user.name
e.datarow.Save
2、startEdit事件,写
If e.Row.DataRow.RowState <> DataRowState.Added Then
Dim fdr As DataRow = e.Table.DataTable.sqlfind("_Identify = " & e.Row("_Identify") )
If fdr IsNot Nothing AndAlso fdr.IsNull("编辑者") = False AndAlso fdr("编辑者") <> user.name Then
e.cancel = True
msgbox(fdr("编辑者") & " 正在编辑")
End If
End If
3、BeforeSaveDataRow事件
e.datarow("编辑者") = nothing
[此贴子已经被作者于2015/10/28 14:54:29编辑过]