Index was out of range

Index was out of range. Must be non-negative and less than the size of the collection. Parameter name: index ?

异常对象是:当参数值超出调用的方法所定义的允许取值范围时引发的异常。

你要判断 DataGradView1中的SelectedRows 对象是否存在!!!!

DataGradView1 对象是存在 但是 SelectedRows 对象没有存在 就是说 你当前没选中行

SelectedRows 对象为空 要操作 SelectedRows 必须判断 SelectedRows 对象是否存在

 

posted @ 2017-12-15 14:02  小猫钓鱼吃鱼  阅读(2225)  评论(0编辑  收藏  举报