怎么才能选中datagridview 中的checkbox????
有个datagridview第一列是checkbox,但是没有能得到绑定数据,想在绑定数据后,再一行行判断是否应该选中,但是怎么选中??下面这方法试了,不行??求教高人???????
string sql = "SELECT * FROM 课程";
SqlMethod.bindDataGridView(dataGridView1 ,sql,"课程",ConnectionCom .getConnection());
int sum = dataGridView1.Rows.Count;
StringCom.showInformation(sum.ToString());
for (int i = 0; i < sum;i++ )
{
//string courceid= dataGridView1.Rows[i].Cells[1].Value.ToString();
////StringCom.showInformation(courceid);
////StringCom.showInformation(temp.ToString());
//if (ConnectionCom.IsHaveSelectCource(stuNumber, Convert .ToInt32(courceid)))
//{
DataGridViewCheckBoxCell checkcell = (DataGridViewCheckBoxCell)dataGridView1.Rows[i].Cells[0];
checkcell.Value = true;
//}