How to check if dataGridView checkBox is checked?

前端 未结 6 1770
猫巷女王i
猫巷女王i 2021-01-04 09:13

I\'m new to programming and C# language. I got stuck, please help. So I have written this code (c# Visual Studio 2012):

private void button2_Click(object sen         


        
6条回答
  •  星月不相逢
    2021-01-04 10:05

    Value return an object type and that cannot be compared to a boolean value. You can cast the value to bool

    if ((bool)row.Cells[1].Value == true)
    {
        // what I want to do
    }
    

提交回复
热议问题