Index was out of range

Posted 小猫钓鱼吃鱼

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了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 对象是否存在

 

以上是关于Index was out of range的主要内容,如果未能解决你的问题,请参考以下文章