DataGridView的CheckBoxCell列在用代码赋值时,怎样使他的状态马上改变(不用单击单元格)

解决方案 »

  1.   


    //还有点没明白你的意思for(int i =0;i<datagridview1.Rows.Count;i++)
    {
       if(datagridview1.Rows[i].Cells["列"].Value == null)
       {
          datagridview1.Rows[i].Cells["列"].Value = true;
       }
    }
      

  2.   

    你是放到Load方法里的吧---------Load中有时候又问题了  不知道怎么的
      

  3.   

    給完值後,提交一下
      dataGridView1.InvalidateCell(datagridview1.Rows[i].Cells["列"]);
      datagridview1.CommitEdit(DataGridViewDataErrorContexts.Commit);