private void btnDel_Click(object sender, EventArgs e) { DataGridViewSelectedRowCollection r = dgvListAcc.SelectedRows; if (r.Count == 1) { int key = Convert.ToInt32(r[0].Cells["Column1"].Value.ToString()); try { BUS_Account.Delete(key); Alert("Đã xóa thành công ^^", frmAlert.Type.Success); dgvListAcc.DataSource = BUS_Account.GetAllAccount(); } catch (Exception) { Alert("Đã xảy ra lỗi !!", frmAlert.Type.Error); } } else { Alert("Vui lòng chọn dòng cần xóa !", frmAlert.Type.Info); } }