Hi, I am trying to assign data to a DataGridView by means of a list, but I only manage to pass data to it once, but I need that when adding several records to the list I will load all those assigned to the list and assign the list to the DGV.
var p = new Persona()
{
Id = Utilidades.RowId,
Nombre = Utilidades.RowDes
};
listPersona.Add(p);
foreach (DataGridViewRow row in dgvPersona.Rows)
{
foreach (var item in listPersona)
{
row.Cells["ColCodigo"].Value = item.Id;
row.Cells["ColName"].Value = item.Nombre;
}
}