怎样实现用checkbox从datagridview中选取多列的值

来源:百度知道 编辑:UC知道 时间:2024/09/20 09:24:25
我是这么写的
dataGridView1.Rows[i].Cells[0].Value.ToString() =="true"
可报错 未将对象引用设置带对象的实例,怎么回事呢

可能不是这句的错误,贴出完整的代码看看
下面换了一种思路代替你的那句代码,试一下,没测试过
checkbox cbox=new checkbox();
cbox=(checkbox)dataGridView1.Rows[i].Cells[0].FindControl("checkbox");
cbox.checked==true;

估计还没有值