我是新来的编程和C#语言。我卡住了,请帮忙。所以我写了这个代码(C#的Visual Studio 2012):如何检查dataGridView复选框是否被选中?
private void button2_Click(object sender, EventArgs e)
{
foreach (DataGridViewRow row in dataGridView1.Rows)
{
if (row.Cells[1].Value == true)
{
// what I want to do
}
}
}
所以我得到以下错误:
操作“==”不能应用于类型的“对象”和操作数“布尔”。
.Cells [1]数字代表什么? –