本文介绍了Gridview RowIndex错误-索引超出范围...的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有几个页面的GridView,我想检索第二页的行索引.
我尝试的以下代码遇到此错误.
Index was out of range.

这是我的代码:

 如果(例如,CommandName == " 开始" )
{
     int  i = Convert.ToInt32(例如CommandArgument);
    GridViewRow行= GridViewArtenVerp.Rows [i];
    // 一些用于检索单元格值的代码
} 



有人可以帮我吗?
在此先谢谢您.
谢谢
faisal




I have GridView with several pages and I want to retrieve the row index of the second page.
I am getting this error for the below code that I tried.
Index was out of range.

here my code is:

if (e.CommandName == "Go")
{
    int i = Convert.ToInt32 (e.CommandArgument);
    GridViewRow row = GridViewArtenVerp.Rows[i];
    // some code to retrieve cellvalues
}



Can someone help me?
Thanks in advance.

解决方案




这篇关于Gridview RowIndex错误-索引超出范围...的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

07-30 08:15