private void grdName_CellClick(object sender, DataGridViewCellEventArgs e) { Part updatePart = new Part(); updatePart.getPart(Convert.ToInt32(grdName.Rows[grdName.CurrentCell.RowIndex].Cells[0].Value)); PartIdtxt.Text = updatePart.getPartID().ToString("00000"); newParttxt.Text = updatePart.getName().ToString(); newCosttxt.Text = updatePart.getCostPrice().ToString(); newSaletxt.Text = updatePart.getSalePrice().ToString(); newQtytxt.Text = updatePart.getQty().ToString(); newStatustxt.Text = updatePart.getStatus().ToString(); UpdatePart.Show(); if (newParttxt.Text == "" || newCosttxt.Text == "" || newSaletxt.Text == "" || newQtytxt.Text == "") { MessageBox.Show("Sorry please enter all fields! ", "Name Error!"); } if (newStatustxt.Text == "Available") { updatePart.setStatus(Convert.ToChar('A')); } else { updatePart.setStatus(Convert.ToChar('D')); } }
private void grdName_CellContentClick(object sender, DataGridViewCellEventArgs e) { UpdatePart.Show(); }