首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > .NET > C# >

dataGridView 有关问题

2012-04-01 
dataGridView 问题我的DataGridViewCheckBoxColumn为什么总选择不了用这个privatevoidDataGridView1_CellC

dataGridView 问题
我的DataGridViewCheckBoxColumn为什么总选择不了用这个
  private   void   DataGridView1_CellContentClick(object   sender,   DataGridViewCellEventArgs   e)
                {

                        if   (e.ColumnIndex   ==   0)
                        {
                                dataGridView1.Rows[e.RowIndex].Cells[0].Value   =   (bool)dataGridView1.Rows[e.RowIndex].Cells[0].EditedFormattedValue;

                        }
                }
dataGridView1.Rows[e.RowIndex].Cells[0].EditedFormattedValue;这个总是返回false


[解决办法]
这样设置就可选中:
this.dataGridView1.Rows[e.RowIndex].Cells[0].Value = "true ";

热点排行