在两种情况下,在asp.net中获取GridView的当前RowIndex(如果已绑定或为Templatefield) [英] Get a Current RowIndex of GridView in asp.net (If It is bounded or Templatefield) in both condition
本文介绍了在两种情况下,在asp.net中获取GridView的当前RowIndex(如果已绑定或为Templatefield)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
亲爱的
我手动添加了边界"和模板"字段列.
现在我有在gridview外面的按钮
当我点击按钮
然后获取gridview的当前rowindex
而我想在另一个页面文本框中传递的数据.
如果有解决方案,请提出建议
我不能使用rowcommand.如果可能的话,
请帮助我
Dear
I added a columns both Bounded and Template field columns manually.
Now i have button which is out side the gridview
When i click the button
then get current rowindex of gridview
And that data I want to pass in another page textbox.
Please suggest me if any solution is there
I cant use rowcommand for it. If it is possible then how
please help me
推荐答案
尊敬的Jagadeesh,
检查此链接,我认为它为您的问题提供了解决方案
http://weblogs.asp.net/gurusarkar/archive/2010/09/22/get-gridview-rowindex-upon-button-click.aspx [
Dear Jagadeesh,
Check this link, I think it gives you solution for your problem
http://weblogs.asp.net/gurusarkar/archive/2010/09/22/get-gridview-rowindex-upon-button-click.aspx[^]
如果要获取选定的gridview索引,可以尝试,
If you want to get the selected index of gridview,you can try,
int index=Gridview1.SelectedIndex;
这篇关于在两种情况下,在asp.net中获取GridView的当前RowIndex(如果已绑定或为Templatefield)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文