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
This code above was wrong!
foreach (DataGridViewRow row in dataGridView1.Rows)
{
DataGridViewCheckBoxCell cell = row.Cells[0] as DataGridViewCheckBoxCell;
// Note: Can't check cell.value for null if Cell is null
// just check cell != null first
//We don't want a null exception!
if (cell.Value != null)
{
if (cell.Value == cell.TrueValue)
{
//It's checked!
}
}
}