private void dataGrid_CellContentClick(object sender, DataGridViewCellEventArgs e) { if (dataGrid.Rows[e.RowIndex].Cells["Eliminar"].Selected) { int eliminar = Convert.ToInt32(dataGrid.Rows[e.RowIndex].Cells["codEmp"].Value.ToString()); objNegocio.N_Eliminar(eliminar); Listar_Empleado(); } else if (dataGrid.Rows[e.RowIndex].Cells["Editar"].Selected) { txtcod.Text = dataGrid.Rows[e.RowIndex].Cells["codEmp"].Value.ToString(); txtnombre.Text = dataGrid.Rows[e.RowIndex].Cells["nomEmp"].Value.ToString(); txtedad.Text = dataGrid.Rows[e.RowIndex].Cells["edadEmp"].Value.ToString(); txtsexo.Text = dataGrid.Rows[e.RowIndex].Cells["sexoEmp"].Value.ToString(); txtsueldo.Text = dataGrid.Rows[e.RowIndex].Cells["sueldoEmp"].Value.ToString(); } }