private void dataGridView1_CellMouseClick(object sender, DataGridViewCellMouseEventArgs e) { if (e.Button == MouseButtons.Right) { if(e.RowIndex >= 0 && e.ColumnIndex == 0) { if(dataGridView1.Rows[e.RowIndex].Cells[0].Value != null) { Point p = new Point(e.Location.X, e.Location.Y); indexSelectedForDeletion = e.RowIndex; contextMenuStrip1.Show(dataGridView1,p); } } } }