无法在gridview中获取rowindex [英] Cannot get rowindex in gridview
问题描述
在RowUpdating活动中,
RowIndex即将推出Null,
,错误是.. 。
指数超出范围。必须是非负数且小于集合的大小。
参数名称:index
GV.DataKeys [e.RowIndex] .Value;
但是Gridview也加载了数据,还有数据密钥。
我是什么尝试过:
我尝试使用Gridview数据,Datakeys在那里,但我找不到bug的位置......
我也试过以下链接...
http://www.codeproject.com/Questions / 1105358 / Html-drop-down-list-shows-past-dates-value
http://www.codeproject.com/Questions/414868/Index-was-out-of-range? tab = mostrecenthttp://www.codeproject.com/Questions/414868/Index-was-out-of-range?tab = mostrecent
http://stackoverflow.com/questions/5381670/index -was-out-of-range-error-in-gridview
http://forums.asp.net/t/1634281.aspx
但是我找不到解决方案。
先谢谢。
In RowUpdating Event,
RowIndex is coming Null,
and the error is...
Index was out of range. Must be non-negative and less than the size of the collection.
Parameter name: index
GV.DataKeys[e.RowIndex].Value;
But Gridview loaded with data, with datakeys too.
What I have tried:
I have tried with Gridview data, Datakeys are there but i could n't find where the bug is...
I have tried the following links too...
http://www.codeproject.com/Questions/1105358/Html-drop-down-list-shows-past-dates-value
http://www.codeproject.com/Questions/414868/Index-was-out-of-range?tab=mostrecenthttp://www.codeproject.com/Questions/414868/Index-was-out-of-range?tab=mostrecent
http://stackoverflow.com/questions/5381670/index-was-out-of-range-error-in-gridview
http://forums.asp.net/t/1634281.aspx
But I cant find the solution.
Thanks in Advance.
推荐答案
您好,请您在此处发布您的代码以绑定GridView和RowUpdating事件吗?
Hi, can you please post your code here for binding your GridView and for your RowUpdating event?
这篇关于无法在gridview中获取rowindex的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!