title: Preventing from Deleting a Row
body: <p>I just created a <code>DataGridView</code> and a delete button that deletes a row. However, I accidentally clicked the delete button, even though there's no data inserted. Application break mode appears. What I did is I created a If-else statement to prevent that from happening. But I can't get it right.</p>
  
  <pre><code>private void button5_Click(object sender, EventArgs e)
  {
      if (dataGridView1.RowCount. = 0)
      {
         MessageBox.Show("Nothing to Delete");
         return;
      }
      else
      {
          MessageBox.Show("Are you sure you want to delete the selected items?", "Students_Records", MessageBoxButtons.OKCancel);
          studentsBindingSource.RemoveCurrent();
      }
  }
  </code></pre>
  
  <p>I always get this error: </p>
  
  <blockquote>
    <p>CS1001    Identifier expected</p>
  </blockquote>
  
  <p>Note: I'm a newbie</p>