2015年1月19日 星期一

VB程式筆記:DataGridView限制UserAddRows




.Net WinForm的DataGridView與WebForm的DataGrid是很相似的東西。

最近要實作一項功能就是DataGridView限制筆數。

能夠讓使用者自行新增(AllowUserToAddRows = true),但又不能超過一定筆數。

試過很多事件OnCellValueChanged、OnCurrentCellChanged、Leave都會出現Error,後來發現在UserAddedRow中實作才沒有Error

以下程式碼記錄




0 comments:

張貼留言