如何通过带有图像ID的gridview的rowindex [英] How to pass rowindex of gridview with id of the image

查看:73
本文介绍了如何通过带有图像ID的gridview的rowindex的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

嗨 如何通过带有图像ID的gridview传递rowindex

Hi How to pass rowindex of gridview with id of the image

OnClientClick= '<%# string.Format("CImg(this,\"{0}\");",Container.DataItemIndex) %>' />



不能正常工作的人可以建议如何实现此方法.



not working can any one suggest how to achieve this

推荐答案

请尝试以下操作,

OnClientClick =返回电话(this)"

假设ur image ctrl位于Item模板中,并且没有其他嵌套元素

javascript:

函数Call(ctrl)
{
var row = ctrl.parentNode.parentNode;//获取包含图像的行
var rowIndex = row.rowIndex;//该行的行索引.
}


希望能对您有所帮助,如果不提供更多详细信息,请再次与我联系.
try the following,

OnClientClick="return Call(this)"

assuming ur image ctrl is in Item template and no other nesting elements are there

javascript:

function Call(ctrl)
{
var row=ctrl.parentNode.parentNode;//to get row containing image
var rowIndex=row.rowIndex;//row index of that row.
}


I hope this helps, if not get back to me with more details.


参考此主题,希望对您有所帮助
http://weblogs.asp.net/gurusarkar/archive/2010/09/22/get-gridview-rowindex-upon-button-click.aspx [
refer this thread, hope might help you
http://weblogs.asp.net/gurusarkar/archive/2010/09/22/get-gridview-rowindex-upon-button-click.aspx[^]


查看此链接-使用Javascript获取GridView选定的行DataKey [网格视图行索引javascript [
Check this link out - Get GridView selected row DataKey in Javascript[^].

I guess this is what you are looking for.

BTW, I got this link by a simple Google search - gridview row index javascript[^].

Hope this helps!


这篇关于如何通过带有图像ID的gridview的rowindex的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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