Q:

Check if dataGridView is empty

I am in need of a simple way for checking if my datagridview is/isn't empty.
The Rows.Count does not satisfy me, because my program starts with 2 empty rows,
 and in the future the datagridview could be populated and then the count
 does not affect anything
(If the users deletes a section but there are more than 2 rows present).
Is there anyway of checking this?

A:

well these are the checking options for whether  datagrid view  is empty or not ......
if(DataGridView1.Rows.Count == 0)
{
    MessageBox.Show("DataGridView is empty");
}

2). You can check the DataTable or DataSet which binds to 
DataGridView:
if(dt == null)
{
   MessageBox.Show("DataGridView is empty");
}

if(ds == null)
{
   MessageBox.Show("DataGridView is empty");
}

you can check with datagrid view cell value also by using this:
if (dataGridView1.Columns[e.ColumnIndex].Name == "companyName")
    {
        if (String.IsNullOrEmpty(e.FormattedValue.ToString()))
        {
            dataGridView1.Rows[e.RowIndex].ErrorText =
                "company Name must not be empty";
            e.Cancel = true;
        }
    }

