gridview中的Editmode指向不同的行 [英] Editmode in gridview is pointing a different row
本文介绍了gridview中的Editmode指向不同的行的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我使用下拉列表从gridview中选择一个特定的行(或第三行),然后当我单击编辑时,editmode指向一个网格的第一行而不是我有的行选择编辑.plzz help.Thanks。
Hi,
Iam selecting a particular row(or a 3rd row) from gridview using dropdownlist,then when I click edit the editmode is pointing to a firstrow of a grid instead the row which I have selected to edit.plzz help.Thanks.
推荐答案
最有可能在编辑按钮单击方法中,您可能使用了如下所示的错误代码。
你必须使用以下代码。
gv.EditIndex = e.RowIndex;
在上面的代码之后你必须重新绑定网格view使用数据源和数据绑定属性和方法控制数据。
most probably in the editbutton click method you may be using wrong code like the one below.
You must use the code as following .
gv.EditIndex=e.RowIndex;
after the above code you must rebind grid view controls data using datasource and databind propert and methods .
这篇关于gridview中的Editmode指向不同的行的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文