private void dataGrid_CellDoubleClick2(object sender, DataGridViewCellEventArgs e) { int index = dataGrid.SelectedRows[0].Index; Product temp = sql.findProduct(Int32.Parse(dataGrid.Rows[index].Cells[0].Value.ToString())); AddProductForm addProduct = new AddProductForm(); addProduct.changeProduct(temp); LoadData(); }
private void EditData() { int index = dataGrid.SelectedRows[0].Index; Product temp = sql.findProduct(Int32.Parse(dataGrid.Rows[index].Cells[0].Value.ToString())); AddProductForm addProduct = new AddProductForm(); addProduct.changeProduct(temp); LoadData(); }