当我在网格视图中单击超级链接时,我得到整行的值 [英] when i click hyper link in grid view i get values of entire row

查看:67
本文介绍了当我在网格视图中单击超级链接时,我得到整行的值的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好

我有一个网格视图,当我单击超链接时,我需要用超链接字段限定一列,我需要获取每个单元格的值.我不知道该过程可以有人告诉我还是请提供示例代码

在此先感谢

hi all

i had a grid view in which i one column bounded with hyperlink field when i click the hyperlink i need to get the values of each cell. i dont know the process can any one tell me please or provide sample code please

thanks in advance

推荐答案

在行命令"事件中,使用以下代码:

In Row Command event use the code as below :

protected void grdDocs_RowCommand(object sender, GridViewCommandEventArgs e)
       {
           if (e.CommandName == "Download")
           {
               GridViewRow row = (GridViewRow)(((LinkButton)e.CommandSource).NamingContainer);
}
}



将命令源转换为您拥有的控件的类型.



Cast your command source as a type of the control you have.


为此,您需要获取被单击的行,从中可以找到每个单元格.要获得该行,请查看以下链接

单击此处
for that ou need to get the clicked row, from that you can find each cell. To get the row, have a look to the following link

Click here


此处检查类似的讨论 [ ^ ]


这篇关于当我在网格视图中单击超级链接时,我得到整行的值的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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