private void deleteToolStripMenuItem_Click(object sender, EventArgs e) { if (MessageBox.Show("Selected record will be deleted", "Delete", MessageBoxButtons.OKCancel, MessageBoxIcon.Exclamation) == DialogResult.OK) { Product delProd = new Product(); delProd.loadProducts(Convert.ToDouble(lsvView.SelectedItems[0].Text)); delProd.delete(); this.loadListviewItem(); } }