如何获取gridview的动态绑定复选框的ID? [英] How to get ID of dynamicaly bind checkbox of gridview?

查看:50
本文介绍了如何获取gridview的动态绑定复选框的ID?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好,
我正在使用c#.net开发一个Web应用程序.我的要求是我必须动态地将数据与gridview绑定,并将复选框从rowdatabound添加到CELL中(Nb:使用Templatefield的我).
现在的问题是我无法从网格列的单元格中找到复选框ID.
COL1 COL2 COL3
数据CHB11 CHB12 CHB13
数据CHB21 CHB22 CHB23
数据CHB31 CHB32 CHB33

IM无法找到CHB的ID(我使用TEMPLETEFILD来绑定CHB)

Hi All,
I am developing a web application using c#.net.My requiredment is that i have to dynamically bind gridview with data and ADDing Checkboxes in to CELL from rowdatabound(Nb:I m nt using Templatefield).
Now the problem is i unable to find the Checkbox ID from cell from grid Column.
COL1 COL2 COL3
DATA CHB11 CHB12 CHB13
DATA CHB21 CHB22 CHB23
DATA CHB31 CHB32 CHB33

I M UNABLE TO FIND CHB''S ID(I NT USING TEMPLETEFILD TO BIND CHB)

推荐答案

如果您不使用模板,是否表示您没有定义ID?您可以按索引查找控件,而不是按名称搜索控件.我不喜欢它,但它易碎且易碎,但可以使用.
If you''re not using a template, does that mean you''re not defining the id ? You can find controls by index, instead of searching for them by name. I dislike it, it''s hacky and fragile, but it works.


这篇关于如何获取gridview的动态绑定复选框的ID?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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