How to check the datagridview not be empty?
<p>I already tried this way but it is not working.</p>

<p>How do I fix it?</p>

<pre><code>     if(dgvProducts.Rows.Count &lt; 1 )
     {
         MessageBox.Show("Something");
         return;
     }
</code></pre>