private void Edit_baton_Click(object sender, EventArgs e) { int currentRow = dataGridView1.CurrentCell.RowIndex; DataGridViewRow selectedRow = dataGridView1.Rows[currentRow]; string name = Convert.ToString(selectedRow.Cells["Name"].Value); string lastname = Convert.ToString(selectedRow.Cells["LastName"].Value); string street = Convert.ToString(selectedRow.Cells["Street"].Value); Add_Or_Edit window = new Add_Or_Edit(name, lastname, street); window.Show(); populateData(); }
private void button1_Click(object sender, EventArgs e) { Add_Or_Edit window = new Add_Or_Edit(); window.Show(); }