获取选中的复选框的id在GridView控件(Asp.net)C# [英] Get the id of selected checkboxes in gridview (Asp.net) c#

查看:427
本文介绍了获取选中的复选框的id在GridView控件(Asp.net)C#的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有两列一个ID&安培;其他的复选框。
我采取的复选框GridView控件中。
我想看看在GridView内部的检查值,如果复选框被选中然后我想这些值即ID
Asp.net


解决方案

 的foreach(Gridviewrow在Gridview1.Rows GVR)
{
 如果(((复选框)gvr.findcontrol(CheckBox1))。经过==真)
 {   INT uPrimaryid = gvr.cells [uPrimaryID];
 }
}

I have two columns one for id & other for checkboxes. i have taken checkboxes inside the gridview. i wanted to see the checked values inside the gridview , If checkboxes are checked then i want those values i.e id Asp.net

解决方案

foreach(Gridviewrow gvr in Gridview1.Rows)
{
 if(((CheckBox)gvr.findcontrol("CheckBox1")).Checked == true)
 {

   int uPrimaryid= gvr.cells["uPrimaryID"];
 }
}

这篇关于获取选中的复选框的id在GridView控件(Asp.net)C#的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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