private void dataGridView1_CellDoubleClick(object sender, DataGridViewCellEventArgs e) { String cod = this.dataGridView1.CurrentRow.Cells[0].Value.ToString(); String nome_mae = this.dataGridView1.CurrentRow.Cells[1].Value.ToString(); Detalhes wf = new Detalhes(cod); wf.Show(); }
private void dataGridView1_KeyDown(object sender, KeyEventArgs e) { if (e.KeyCode == Keys.Enter) { String cod = this.dataGridView1.CurrentRow.Cells[0].Value.ToString(); String nome_mae = this.dataGridView1.CurrentRow.Cells[1].Value.ToString(); Detalhes wf = new Detalhes(cod); wf.Show(); } }
public void informacoes() { try { String cod = this.dataGridView1.CurrentRow.Cells[0].Value.ToString(); String nome_mae = this.dataGridView1.CurrentRow.Cells[1].Value.ToString(); Detalhes wf = new Detalhes(cod); wf.Show(); } catch (System.NullReferenceException e) { } }