正在访问行号gridview的 [英] accessing row no. of gridview

查看:60
本文介绍了正在访问行号gridview的的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个gridview,在我的项目模板中,我使用了一个链接按钮.在运行时,当我单击链接按钮时,我想要网格的相应行号. plz help .......

i have a gridview, in the item template of which i have taken a link button. At run time when i click on the link button i want the corresponding row number of the grid. plz help.......

推荐答案


试试这个:
将其放在要检查命令的RowCommand事件中.
Hi,
Try this:
Put it inside your RowCommand Event, where you are checking the command.
if(e.CommandName="MyCommand"){
     GridViewRow gvr = (GridViewRow)(((LinkButton)e.CommandSource).NamingContainer);
     int RowIndex = gvr.RowIndex; 
}




--Amit




--Amit


这篇关于正在访问行号gridview的的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆