private void button2_Click(object sender, EventArgs e) { int selectedrowindex = dataGridAdmins.SelectedCells[0].RowIndex; DataGridViewRow selectedRow = dataGridAdmins.Rows[selectedrowindex]; int selected_id = Convert.ToInt32(selectedRow.Cells["id"].Value); EditAdmin ea = new EditAdmin(selected_id); ea.Show(); }
private void BtnEdit_Click(object sender, RoutedEventArgs e) { EditAdmin editAdminWindow = new EditAdmin(admin); editAdminWindow.Show(); }