If e.DataCol.Name = "支出账户" Then
If e.DataRow("支出项目").Contains("杂费") Then
If e.NewValue IsNot Nothing Then
Dim Result As DialogResult
Result = MessageBox.Show("确定支出吗?", "提示", MessageBoxButtons.YesNo, MessageBoxIcon.Question)
If Result = DialogResult.No Then
e.DataRow("支出账户") = Nothing
End If
If Result = DialogResult.Yes Then
e.DataRow("录入日期") = Date.Today()
e.DataRow.Locked = True
End If
End If
End If
End If
代码很好用。但是原来的功能不能实现了(不包含杂费的行),即如果支出账户不是空值那么录入日期= Date.Today() e.DataRow.Locked = True
[此贴子已经被作者于2011-10-25 20:23:34编辑过]