检索gridview上的选定行字段复选框已选中n未选中 [英] retrive the selected row fields on gridview checkbox checked n unchecked

查看:49
本文介绍了检索gridview上的选定行字段复选框已选中n未选中的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述


我有一个gridview在模板字段中,有一个复选框.
在复选框处于选中状态或未选中状态时,我要检索选定的行值.我该怎么做?请帮助.
此致
Rajni pal


I have a gridview where in Template field,m having a checkbox.
On checkbox checked or unchecked, i want to retrive the selected row values.how can i do it? plz help..
Regards ,
Rajni pal

推荐答案

好吧,尽管您的问题不太清楚,但我认为这有点像:
您有一个带有复选框的网格.在页面提交时,您需要选中其复选框的行.为此,请尝试:
1.使用foreach循环遍历网格行.
2.每行,使用FindControl查找复选框
3.检查找到的复选框的状态.如果已选中,则将其用于已检查的情况,或者用于未检查的情况.

完成.
Well, though your question is not quite clear, I assume it''s something like:
You have a grid with checkboxes. At submit of page, you need to get the rows that has it''s checkbox checked. For this, try:
1. Use a foreach loop to loop through the grid rows.
2. Per row, find the checkbox using FindControl
3. Check the state of the checkbox found. If it is checked, use it for checked case or else for unchecked one.

Done.


这篇关于检索gridview上的选定行字段复选框已选中n未选中的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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