private void dgvClientes_CellContentClick(object sender, DataGridViewCellEventArgs e) { try { DataGridView dataGridView = sender as DataGridView; if (dataGridView.Columns[e.ColumnIndex] is DataGridViewButtonColumn && e.RowIndex >= 0) { if (e.ColumnIndex == 6) { // EDITAR string documento = dataGridView.Rows[e.RowIndex].Cells[0].Value.ToString(); GestionCliente gestionCliente = new GestionCliente(documento); gestionCliente.ShowDialog(); } } } catch (Exception ex) { MessageBox.Show(ex.Message, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error); } }
private void btnNuevo_Click(object sender, EventArgs e) { GestionCliente gestionCliente = new GestionCliente(); gestionCliente.ShowDialog(); }