private void button1_Click(object sender, EventArgs e) { int pos = 0; try { pos = dataGridView1.CurrentCell.RowIndex; int datoId = (int)dataGridView1[0, pos].Value; DetallesAgente d = new DetallesAgente(datoId, this); d.MdiParent = this.MdiParent; d.Show(); this.Dispose(); } catch { MessageBox.Show("Seleccione un agente de la lista"); } }
private void button1_Click(object sender, EventArgs e) { int pos = 0; try { pos = dataGridView1.CurrentCell.RowIndex; int datoId = (int)dataGridView1[0, pos].Value; DetallesAgente d = new DetallesAgente(datoId, this); d.MdiParent = this.MdiParent; d.Show(); this.Dispose(); } catch { MessageBox.Show("Seleccione un agente de la lista"); } }