gridview中的行命令. [英] Row Command in gridview.

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

问题描述

如何在rowview函数的gridview中选择行值?

请帮帮我.

在此先感谢..

How we can select rows value in gridview on row command function ?

Please help me.

Thanks in Advance..

推荐答案

我们通常使用row命令的Command Argument属性来保存row的索引,然后利用它来检索行信息. br/>
单击此处以了解有关GridViewCommandEventArgs的更多详细信息
We usually use the Command Argument property of the row command to hold the index of row, then utilize it for retrieving the row information.

Click here for more details about GridViewCommandEventArgs


希望 [ ^ ]可能会帮助您.
Hope this[^] might help you.


您可以将rowindex通过命令参数设置为
You can set the rowindex throug command argument as
CommandArgument='<%#Eval((GridViewRow)Container.RowIndex))%>'


在代码后面,


From Code behind,

int index=convert.toint32(e.commandargument.tostring());
label lbl=(label)gridview1.rows[index].findcontrol("Labelnam");
string name=lbl.text;


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

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