如何在GridView中启用复选框 [英] How to enable the checkbox in a gridview
问题描述
我正在向数据表中动态添加一个布尔列.数据表是GridView的数据源.
问题:此动态生成的列的复选框均被禁用.如何启用它们?
dt.column.add("check",typeof(Boolean));
dt.column ["check"].Readonly = false;
换句话说,如何控制GridView如何为布尔字段生成CheckBoxes? (为什么将ReadOnly设置为False无效?)
如何使gridview列不是只读的?
谢谢
I''m dynamically adding a Boolean column to a Datatable. The datatable is the DataSource for a GridView
Issue: The checkboxes for this dynamically generated column are all disabled. How can I enable them?
dt.column.add("check",typeof(Boolean));
dt.column["check"].Readonly = false;
In other words, how can I control how GridView generates the CheckBoxes for a Boolean field? (And why does setting ReadOnly to False have no effect?)
how to make the gridview column not readonly?
Thanks
推荐答案
这是
This is a repost of this previous question.
That is just the data behind the GridView. You need to modify the GridView column to not be readonly (i.e., in the above code you are modifying the DataTable column, which you should not be doing).
第二和第三结果
下次,您自己搜索它.
Let Me Google That For You: Second and Third Results
Next time, Google it yourself.
这篇关于如何在GridView中启用复选框的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!