public void cargardata() { if (metodo == 1) { dataGridView1.DataSource = op.MostrarDoctor(); dataGridView1.Columns[2].Visible = false; dataGridView1.Columns[3].Visible = false; dataGridView1.Columns[4].Visible = false; } else if (metodo == 2) { dataGridView1.DataSource = op.MostrarPaciente(); dataGridView1.Columns[2].Visible = false; dataGridView1.Columns[3].Visible = false; dataGridView1.Columns[4].Visible = false; dataGridView1.Columns[5].Visible = false; } else if (metodo == 3) { dataGridView1.DataSource = op.MostrarUsuario(); dataGridView1.Columns[2].Visible = false; dataGridView1.Columns[3].Visible = false; dataGridView1.Columns[4].Visible = false; } else if (metodo == 4) { dataGridView1.DataSource = op.MostrarBitacora(); dataGridView1.Columns[0].Visible = false; dataGridView1.Columns[2].Visible = false; } else if (metodo == 5) { dataGridView1.DataSource = op.MostrarExamenes(); dataGridView1.Columns[0].Visible = false; dataGridView1.Columns[2].Visible = false; dataGridView1.Columns[3].Visible = false; dataGridView1.Columns[4].Visible = false; } else if (metodo == 6) { dataGridView1.DataSource = op.MostrarCai(); dataGridView1.Columns[1].Visible = false; dataGridView1.Columns[2].Visible = false; } }
public void cargardata() { Array.Clear(Elegir_Examen.cod, 0, 99); Array.Clear(Elegir_Examen.nombre, 0, 99); Array.Clear(Elegir_Examen.precio, 0, 99); ArrayList row = new ArrayList(); dataGridView1.DataSource = op.MostrarExamenes(); dataGridView1.Columns[2].Visible = false; dataGridView1.Columns[4].Visible = false; DataGridViewCheckBoxColumn chk = new DataGridViewCheckBoxColumn(); chk.HeaderText = "Seleccionar"; chk.Width = 100; dataGridView1.Columns.Add(chk); }