I have different lists of different objects and a ComboBox
with the names of each list.
How can I do so that each time I choose the name of a list the Datagridview
shows the chosen option?
With DataSource
I can only select one, as soon as I try to put conditionals for the different selections of Combobox
it does not show me anything anymore.
I've tried with this to test if I can choose between these two lists but logically it does not work ....
cmbEntidades.Items.Add("pelicula");
cmbEntidades.Items.Add("libro");
if (cmbEntidades.Text == "libro")
{
i = librosPorDefecto();
dgv1.DataSource = listaLibros;
}
else if(cmbEntidades.Text == "pelicula")
{
i = peliculasPorDefecto();
dgv1.DataSource = listaPeliculas;
}
Thanks !!!