private void txtBuscar_TextChanged(object sender, EventArgs e) { if (string.IsNullOrWhiteSpace(txtBuscar.Text)) { ActualizarLista(gestor.Listar()); } else { ActualizarLista(gestor.Listar(txtBuscar.Text)); } }
private void Consulta_Load(object sender, EventArgs e) { Estilo.Modificar(btnModificar); Estilo.Nuevo(btnNuevo); Estilo.Imprimir(btnImprimir); gestor = new GestionarConsulta(); lista = gestor.Listar(); dataGridView1.ColumnCount = 5; dataGridView1.Columns[0].Name = "Id"; dataGridView1.Columns[1].Name = "Dni"; dataGridView1.Columns[2].Name = "Nombre"; dataGridView1.Columns[3].Name = "Apellido"; dataGridView1.Columns[4].Name = "Resumen"; dataGridView1.Columns[0].Width = 25; dataGridView1.Columns[1].Width = 100; dataGridView1.Columns[2].Width = 170; dataGridView1.Columns[3].Width = 170; dataGridView1.Columns[4].Width = 240; ActualizarLista(lista); }