示例#1
0
        private void llenarGrillaMaestro()
        {
            mgAlumno.Rows.Clear();
            MaestroComponent personaComponent = new MaestroComponent();

            List <Maestro> listaPersona = new List <Maestro>();

            listaPersona = personaComponent.Read();
            int n = 0;

            foreach (var item in listaPersona)
            {
                n = mgAlumno.Rows.Add();
                mgAlumno.Rows[n].Cells[0].Value = item.Id;
                mgAlumno.Rows[n].Cells[1].Value = item.nombre;
                mgAlumno.Rows[n].Cells[2].Value = item.apellido;
                mgAlumno.Rows[n].Cells[3].Value = item.direccion;
                mgAlumno.Rows[n].Cells[4].Value = item.DNI;
                mgAlumno.Rows[n].Cells[5].Value = item.fechaNacimiento;
                n++;
            }
        }