title: How to check empty and null cells in datagridview using C#
body: <p>i am trying to check the datagridview cells for empty and null value... but i can not do it right...</p>
  
  <pre><code>for (int i = 0; i &lt; dataGridView1.Rows.Count; i++)
  {
      if ((String)dataGridView1.Rows[i].Cells[3].Value == String.Empty)
      {
          MessageBox.Show(" cell is empty");
          return;
      }
  
      if ((String)dataGridView1.Rows[i].Cells[3].Value == "")
      {
          MessageBox.Show("cell in empty");
          return ;
      }
  }
  </code></pre>
  
  <p>i even tried this codes</p>
  
  <pre><code>if (String.IsNullOrEmpty(dataGridView1.Rows[i].Cells[3].Value))
  {
    MessageBox.Show("cell is empty");
    return;
  }
  </code></pre>
  
  <p>can any one help me.. with this...</p>