private void button1_Click(object sender, EventArgs e) { AddEditCell f = new AddEditCell(); var res = f.ShowDialog(); if (res == DialogResult.OK) { CellForms_Load(null, null); } }
private void button2_Click(object sender, EventArgs e) { if (productsDataGridView.SelectedCells.Count != 1) { MessageBox.Show("Choose the one row to edit !"); return; } var row = productsDataGridView.SelectedCells[0]; int RowIndex = ((System.Windows.Forms.DataGridViewTextBoxCell)row).RowIndex; int sID = (int)productsDataGridView[0, RowIndex].Value; AddEditCell f = new AddEditCell(sID.ToString()); var res = f.ShowDialog(); if (res == DialogResult.OK) { CellForms_Load(null, null); } }