如何添加将动态出现在数据表中的复选框(输入html控件)? [英] how to add checkbox(input html control) which will be appear dynamically in datatable?

查看:73
本文介绍了如何添加将动态出现在数据表中的复选框(输入html控件)?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

嗨!
我想知道如何添加复选框(输入html控件),该复选框将动态出现在数据表中.有人可以解释吗?

Snow

Hi!
I want to know how to add checkbox(input html control) which will be appear dynamically in datatable.Can anyone explain it?

Snow

推荐答案

请告诉我您正在使用哪个控件来呈现复选框?

我假设您正在使用GridView控件.
在这种情况下,您必须在布尔数据类型的数据表中添加列.

Please let me know which control you are using to render the checkbox?

I assume that you are using GridView control.
In this case you have to add column in Datatable of Boolean datatype.

DataTable dt=new DataTable();<br />
dt.Columns.add("Col1",String);<br />
dt.Columns.add("Col2",Boolean);//This column will be display as CheckBox<br />
<br />
GridView1.DataSource= dt;<br />
GridView1.DataBind();



希望对您有帮助.



Hope this help you.


这篇关于如何添加将动态出现在数据表中的复选框(输入html控件)?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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