winform DataGridViewCheckBoxCell值的设置与获取

winform控件DataGridViewCheckBoxCell

1.设置值(选中或不选中):

DataGridViewCheckBoxCell cell = (DataGridViewCheckBoxCell)row.Cells[0];
cell.Value = cbxSelectAll.Checked;//直接赋值bool值

2. 获取值(true / false)

Convert.ToBoolean(cellCbx.Value) //转换成bool值

参考文章:https://www.cnblogs.com/cxhu-gis/p/4990567.html

猜你喜欢

转载自blog.csdn.net/zhouyingge1104/article/details/82591973