private void dataGridView1_CellContentClick(object sender, DataGridViewCellEventArgs e) { int rowIndex = dataGridView1.CurrentCell.RowIndex; if (rows[rowIndex].Cells[3].Selected) { string hostName = dataGridView1.Rows[e.RowIndex].Cells[0].Value.ToString(); monitorSystem.removeHost(new Host(hostName)); dataGridView1.Rows.RemoveAt(rowIndex); } }