I'm trying to check if the dataGridView CheckBox column is checked, and when I run the program it gives me this an error as:
Object reference not set to an instance of an object
anyone to help?
C# code:
for(int i = 0; i < payRollDataGrid.Rows.Count; i++)
{
bool isCellChecked = (bool)payRollDataGrid.Rows[i].Cells[0].Value;
if (isCellChecked == true)
{
MessageBox.Show(payRollDataGrid.Rows[i].Cells[1].Value + "Cheked");
}
}