我使用下面的代码,以获得行索引获取GridView的行索引
protected void gvESAPending_RowCommand(object sender, GridViewCommandEventArgs e)
{
try
{
lblMsg.Text = "";
int index = Convert.ToInt32(e.CommandArgument);
GridViewRow row = gvESAPending.Rows[index]; // Here incorrect format error is coming
}
}
不过该指标值来为0。这里有什么问题?
.aspx的代码
“> “>
看看[GridView.RowCommand事件](http://msdn.microsoft.com/en-us/library/system.web.ui.webcontrols.gridview.rowcommand.aspx) –
我试过同样的方法仍然没有帮助 –
指数超出范围。必须是非负数且小于集合的大小。 参数名称:index –