private void BtnXoa_Click(object sender, EventArgs e) { DataView dv = (DataView)DGRDsanphamnhap.DataSource; DataTable t = dv.ToTable(); DialogResult = MessageBox.Show("Bạn có chắc chắn muốn xóa!", "Thông báo", MessageBoxButtons.OKCancel, MessageBoxIcon.Warning); if (DialogResult == DialogResult.OK) { foreach (DataGridViewCell item in this.DGRDsanphamnhap.SelectedCells) { ctpn.Xoa_CTPN(MaPN, int.Parse(t.Rows[item.RowIndex]["MaSP"].ToString())); } } Hien(); }