如何使Griedview中的复选框启用为假? [英] How Can I Make Checkbox In Griedview Enabled As False?
本文介绍了如何使Griedview中的复选框启用为假?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我想将datagriedview中的复选框设置为false ...复选框不应该在运行时接受值true / false。
我使用以下代码复选框
i want to make checkbox in datagriedview enabled as false... checkbox should not accept value true/false in run time.
I used following code for checkbox
DataGridViewCheckBoxColumn chk = new DataGridViewCheckBoxColumn();
dgvdisplay.Columns.Add(chk);
chk.HeaderText = "THEORY(previous)";
有人可以帮我吗?
can anyone help me?
推荐答案
DataGridViewCheckBoxColumn上有两个属性。一个是TrueValue和ReadOnly。
请将这两个属性设为true。
There are two properties on DataGridViewCheckBoxColumn. One is TrueValue and ReadOnly.
Please make this two properties as "true".
DataGridViewCheckBoxColumn chk = new DataGridViewCheckBoxColumn();
chk.TrueValue = true;
chk.ReadOnly =true;
这可以解决您的问题。
This should solve your issue.
这篇关于如何使Griedview中的复选框启用为假?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文