private void dataGridView2_CellDoubleClick(object sender, DataGridViewCellEventArgs e) { if (e.RowIndex >= 0) { DataGridViewRow row = this.dataGridView1.Rows[e.RowIndex]; string iidArea = row.Cells["Id"].Value.ToString(); Formularios.Catalogos.Local.Form_Areas frm = new Formularios.Catalogos.Local.Form_Areas(iidArea); frm.Lista_Areas += new Form1.MessageHandler(Lista_Areas); frm.ShowDialog(); } }
private void toolStripButton_Edit_Click(object sender, EventArgs e) { int contador = 0; dataGridView1.EndEdit(); foreach (DataGridViewRow registro in dataGridView1.Rows) { try { if ((Boolean)registro.Cells["Seleccionar"].Value == true) { contador++; } } catch { } } if (contador == 0) { MessageBox.Show("Debe seleccionar al menos un registro."); return; } if (contador != 1) { MessageBox.Show("Solo puede seleccionar un campo para su edicion. "); } else { dataGridView1.EndEdit(); foreach (DataGridViewRow registro in dataGridView1.Rows) { try { if ((Boolean)registro.Cells["Seleccionar"].Value == true) { string iidArea = registro.Cells["Id"].Value.ToString(); Formularios.Catalogos.Local.Form_Areas frm = new Formularios.Catalogos.Local.Form_Areas(iidArea); frm.Lista_Areas += new Form1.MessageHandler(Lista_Areas); frm.ShowDialog(); } } catch { } } } }
private void toolStripButton_Add_Click(object sender, EventArgs e) { Formularios.Catalogos.Local.Form_Areas frm = new Formularios.Catalogos.Local.Form_Areas(""); frm.Lista_Areas += new Form1.MessageHandler(Lista_Areas); frm.ShowDialog(); }