限制增加数据行数,在beforeAddDataRow事件写代码
If e.DataTable.DataRows.Count >= 200 Then
msgbox("不能再添加")
e.Cancel = true
End If