选中复选框时如何获取gridview行值。 [英] how to get gridview row values when checkbox is checked.
本文介绍了选中复选框时如何获取gridview行值。的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
如何在选中复选框时获取gridview行值。我正在使用visual studio 2010.
how to get gridview row values when checkbox is checked. i am using visual studio 2010.
推荐答案
似乎你到目前为止还没有尝试过任何东西,甚至懒得去Gooogle ..请看看这个:
Seems like you''ve not tried anything so far and not even bother to Gooogle.. Please take a look at this :
string strEmail=stirng.Empty;
foreach (GridViewRow rw in grid1.Rows)
{
CheckBox chkBx = (CheckBox)rw.FindControl("Check");
if (chkBx != null && chkBx.Checked)
{
strEmail = ((Label)rw.FindControl("lblEmail")).Text;
//lblEmail is ID of the label for which you are binding EmailID's.
// here strEmail is ready with your email id. Do the operation here.
}
}
(来自在选中复选框时如何获取gridview行值? [ ^ ])
这篇关于选中复选框时如何获取gridview行值。的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文