1
I’m trying to insert a List<>
(Generated by another class that brings the data from the Database), the data is inserted but the ListView
receives only the first column, and the other is null.
Below is the code of form
where the ListView
, tried something with the foreach
but I was also unsuccessful
private void Form_Usuarios_Load(object sender, EventArgs e)
{
List<Usuario> usuarios = new List<Usuario>();
UsuarioDAO usuario = new UsuarioDAO();
usuarios = usuario.MostrarUsuarios().ToList();
foreach(var item in usuarios)
{
listViewUsuarios.Items.Add(new ListViewItem(new string[] { item.Nome}));
}
}
Upshot:
You do not put the solution in the question, but in the answer I will reverse it and you put as answer.
– novic